rsi买入指标-rsi指标买入法

2023-03-05 技术指标 0次阅读 admin

关于rsi买入指标内容导航:

1、rsi买入指标


:param data:
:return:
"""
data['RSI_6'] = talib.RSI(data['close'], timeperiod=6)
data['RSI_12'] = talib.RSI(data['close'], timeperiod=12)
data['RSI_24'] = talib.RSI(data['close'], timeperiod=24)
data['RSI_6_BUY'] = np.where(data['RSI_6'] < 30, 1, 0)
data['RSI_12_BUY'] = np.where(data['RSI_12'] < 30, 1, 0)
data['RSI_24_BUY'] = np.where(data['RSI_24'] < 30, 1, 0)
return data


def macd_buy_indicator(data):
"""
macd买入指标
:param data:
:return:
"""
data['DIF'], data['DEA'], data['MACD'] = talib.MACD(data['close'], fastperiod=12, slowperiod=26, signalperiod=9)
data['MACD_BUY'] = np.where((data['DIF'] > 0) & (data['MACD'] > 0), 1, 0)
return data


def boll_buy_indicator(data):
"""
布林买入指标
:param data:
:return:
"""
data['UPPER'], data['MID'], data['LOWER'] = talib.BBANDS(data['close'], timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
data['BOLL_BUY'] = np.where(data['close'] < data['LOWER'], 1, 0)
return data


def kdj_buy_indicator(data):
"""
kdj买入指标
:param data:
:return:
"""
data['K'], data['D'] = talib.STOCH(data['high'], data['low'], data['close'], fastk_period=9, slowk_period=3,
slowd_period=3)
data['KDJ_BUY'] = np.where((data['K'] < 20) & (data['D'] < 20), 1, 0)
return data


def cci_buy_indicator(data):
"""
cci买入指标
:param data:
:return:
"""
data['CCI'] = talib.CCI(data['high'], data['low'], data['close'], timeperiod=14)
data['CCI_BUY'] = np.where(data['CCI'] < -100, 1, 0)
return data


def ma_sell_indicator(data):
"""
ma卖出指标
:param data:
:return:
"""
data['MA_5'] = talib.MA(data['close'], timeperiod=5)
data['MA_10'] = talib.MA(data['close'], timeperiod=10)
data['MA_20'] = talib.MA(data['close'], timeperiod=20)
data['MA_30'] = talib.MA(data['close'], timeperiod=30)
data['MA_5_SELL'] = np.where(data['close'] < data['MA_5'], 1, 0)
data['MA_10_SELL'] = np.where(data['close'] < data['MA_10'], 1, 0)
data['MA_20_SELL'] = np.where(data['close'] < data['MA_20'], 1, 0)
data['MA_30_SELL'] = np.where(data['close'] < data['MA_30'], 1, 0)
return data


def rsi_sell_indicator(data):
"""
rsi卖出指标
:param data:
:return:
"""
data['RSI_6'] = talib.RSI(data['close'], timeperiod=6)
data['RSI_12'] = talib.RSI(data['close'], timeperiod=12)
data['RSI_24'] = talib.RSI(data['close'], timeperiod=24)
data['RSI_6_SELL'] = np.where(data['RSI_6'] > 70, 1, 0)
data['RSI_12_SELL'] = np.where(data['RSI_12'] > 70, 1, 0)
data['RSI_24_SELL'] = np.where(data['RSI_24'] > 70, 1, 0)
return data


def macd_sell_indicator(data):
"""
macd卖出指标
:param data:
:return:
"""
data['DIF'], data['DEA'], data['MACD'] = talib.MACD(data['close'], fastperiod=12, slowperiod=26, signalperiod=9)
data['MACD_SELL'] = np.where((data['DIF'] < 0) & (data['MACD'] < 0), 1, 0)
return data


def boll_sell_indicator(data):
"""
布林卖出指标
:param data:
:return:
"""
data['UPPER'], data['MID'], data['LOWER'] = talib.BBANDS(data['close'], timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
data['BOLL_SELL'] = np.where(data['close'] > data['UPPER'], 1, 0)
return data


def kdj_sell_indicator(data):
"""
kdj卖出指标
:param data:
:return:
"""
data['K'], data['D'] = talib.STOCH(data['high'], data['low'], data['close'], fastk_period=9, slowk_period=3,
slowd_period=3)
data['KDJ_SELL'] = np.where((data['K'] > 80) & (data['D'] > 80), 1, 0)
return data


def cci_sell_indicator(data):
"""
cci卖出指标
:param data:
:return:
"""
data['CCI'] = talib.CCI(data['high'], data['low'], data['close'], timeperiod=14)
data['CCI_SELL'] = np.where(data['CCI'] > 100, 1, 0)
return data


def get_indicator(data):
"""
获取指标
:param data:
:return:
"""
data = ma_buy_indicator(data)
data = rsi_buy_indicator(data)
data = macd_buy_indicator(data)
data = boll_buy_indicator(data)
data = kdj_buy_indicator(data)
data = cci_buy_indicator(data)
data = ma_sell_indicator(data)
data = rsi_sell_indicator(data)
data = macd_sell_indicator(data)
data = boll_sell_indicator(data)
data = kdj_sell_indicator(data)
data = cci_sell_indicator(data)
return data

2、rsi指标买入法

3、rsi买卖指标

相对强弱指标:RSI (Relative Strength Index) 强弱指标最早被应用于期货买卖,后来人们发现在众多的图表技术分析中,强弱指标的理论和实践极其适合于股票市场的短线投资,于是被用于股票升跌的测量和分析中。
rsi买卖指标

如果rsi创新高,但是价格却没有创新高,一般情况下,股价的上行会非常困难,调整的概率很大,如果是rsi创新低,但是价格却没有创新低,那么恭喜你,你绝对选了一个好股,股价飙升在即。你可以看看4月24日000078的rsi和000002的4月28日的rsi指标。非常明显。
猜你感兴趣: rsi买入指标