RSI指标:判断股票是超买还是超卖

📊 RSI 是什么?

RSI(Relative Strength Index)相对强弱指标,用来判断股票买的人多还是卖的人多

取值范围:0 ~ 100

  • 📈 RSI > 70 → 超买(可能该卖了)
  • 📉 RSI 超卖(可能该买了)
  • ➡️ RSI = 50 → 多空平衡

👨‍💻 用Python计算RSI

import pandas as pd

# 假设有收盘价
prices = [100, 102, 101, 105, 103, 107, 110, 108, 112, 115]
df = pd.DataFrame({"收盘": prices})

# 计算RSI(14日)
delta = df["收盘"].diff()  # 差值
gain = delta.where(delta > 0, 0)  # 上涨
loss = -delta.where(delta 

🎯 RSI 交易信号

# RSI  70 → 卖出信号(超买)
if rsi > 70:
    print("超买!可能回调")

# RSI 50 作为多空分界
if rsi > 50:
    print("多头趋势")
else:
    print("空头趋势")

📈 完整例子

import akshare as ak
import pandas as pd
import matplotlib.pyplot as plt

plt.rcParams["font.sans-serif"] = ["SimHei"]
plt.rcParams["axes.unicode_minus"] = False

# 获取数据
df = ak.stock_zh_a_hist(symbol="600519", adjust="qfq")
df = df.tail(60)

# 计算RSI
delta = df["收盘"].diff()
gain = delta.where(delta > 0, 0)
loss = -delta.where(delta 

⚠️ RSI 的缺点

  • 📊 震荡行情中容易来回假信号
  • ⏰ 只能参考,不能单独用
  • 🔧 最好配合均线、成交量一起看

💡 小结

  • RSI > 70:可能该卖了
  • RSI
  • RSI > 50:多头
  • RSI

📚 下一课

学会了RSI,我们来学KDJ指标——更灵敏的短线指标!

发表评论