rsi底背离-rsi底背离是不是买入信号

2023-03-06 20:05:06 技术指标 0次阅读 投稿:admin

关于rsi底背离内容导航:

1、rsi底背离


:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_UP
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['rsi']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['rsi']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['rsi']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['rsi']:
return True
else:
trend = TREND_UP
i += 1
return False

def rsi_top_divergence(df, n):
'''
判断rsi顶背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_DOWN
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['rsi']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['rsi']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['rsi']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['rsi']:
return True
else:
trend = TREND_UP
i += 1
return False

def macd_bottom_divergence(df, n):
'''
判断macd底背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_UP
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['macd']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['macd']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['macd']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['macd']:
return True
else:
trend = TREND_UP
i += 1
return False

def macd_top_divergence(df, n):
'''
判断macd顶背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_DOWN
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['macd']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['macd']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['macd']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['macd']:
return True
else:
trend = TREND_UP
i += 1
return False

def kdj_bottom_divergence(df, n):
'''
判断kdj底背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_UP
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['kdj_k']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['kdj_k']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['kdj_k']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['kdj_k']:
return True
else:
trend = TREND_UP
i += 1
return False

def kdj_top_divergence(df, n):
'''
判断kdj顶背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_DOWN
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['kdj_k']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['kdj_k']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['kdj_k']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['kdj_k']:
return True
else:
trend = TREND_UP
i += 1
return False

def boll_bottom_divergence(df, n):
'''
判断boll底背离
:param df:
:param n:
:return:
'''
df = df.sort_index(ascending=False)
i = 0
TREND_UP, TREND_DOWN = 1, 2
trend = TREND_UP
while i < df.shape[0]:
if trend == TREND_UP:
if df.iloc[i]['close'] < df.iloc[i]['boll_mid']:
if df.iloc[i-1]['close'] > df.iloc[i-1]['boll_mid']:
return True
else:
trend = TREND_DOWN
elif trend == TREND_DOWN:
if df.iloc[i]['close'] > df.iloc[i]['boll_mid']:
if df.iloc[i-1]['close'] < df.iloc[i-1]['boll_mid']:
return True
else:
trend = TREND_UP
i += 1
return False

def boll_top_divergence(df, n):
'''
判断boll顶背离
:param df:
:param n:
:return:
'''
df =

2、rsi底背离是什么意思

底背离不是却力策哪条线上(下)穿哪条线,是股价创了新低,但是RSI指标没有创新低,或者反而向上!
rsi底背离是什么意思

3、rsi底背离是不是买入信号

声明:稳得一批是理财投资基础知识平台! 并不指导专业性投资! 投资有风险,入市需谨慎!