关于rsi指标内容导航:
1、rsi指标
def get_rsi(self, n, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
rsi = talib.RSI(close_array, timeperiod=n)
if array:
return rsi
return rsi[-1]
# 获取macd指标
def get_macd(self, fastperiod=12, slowperiod=26, signalperiod=9, array=False):
"""
:param fastperiod:
:param slowperiod:
:param signalperiod:
:param array:
:return:
"""
close_array = self.close_array
macd, signal, hist = talib.MACD(close_array, fastperiod=fastperiod,
slowperiod=slowperiod, signalperiod=signalperiod)
if array:
return macd, signal, hist
return macd[-1], signal[-1], hist[-1]
# 获取kdj指标
def get_kdj(self, n=9, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
low_list = self.low_list
high_list = self.high_list
k, d = talib.STOCH(high_list, low_list, close_array, fastk_period=n, slowk_period=3, slowd_period=3)
j = 3 * k - 2 * d
if array:
return k, d, j
return k[-1], d[-1], j[-1]
# 获取boll指标
def get_boll(self, n=20, dev=2.0, array=False):
"""
:param n:
:param dev:
:param array:
:return:
"""
close_array = self.close_array
mid = talib.MA(close_array, timeperiod=n, matype=0)
std = talib.STDDEV(close_array, timeperiod=n)
up = mid + std * dev
down = mid - std * dev
if array:
return up, down
return up[-1], down[-1]
# 获取cci指标
def get_cci(self, n=14, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
low_list = self.low_list
high_list = self.high_list
cci = talib.CCI(high_list, low_list, close_array, timeperiod=n)
if array:
return cci
return cci[-1]
# 获取wr指标
def get_wr(self, n=10, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
low_list = self.low_list
high_list = self.high_list
wr = talib.WILLR(high_list, low_list, close_array, timeperiod=n)
if array:
return wr
return wr[-1]
# 获取sar指标
def get_sar(self, array=False):
"""
:param array:
:return:
"""
high_list = self.high_list
low_list = self.low_list
sar = talib.SAR(high_list, low_list)
if array:
return sar
return sar[-1]
# 获取dmi指标
def get_dmi(self, n=14, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
low_list = self.low_list
high_list = self.high_list
minus_di, plus_di = talib.MINUS_DI(high_list, low_list, close_array, timeperiod=n), talib.PLUS_DI(
high_list, low_list, close_array, timeperiod=n)
adx = talib.ADX(high_list, low_list, close_array, timeperiod=n)
if array:
return minus_di, plus_di, adx
return minus_di[-1], plus_di[-1], adx[-1]
# 获取trix指标
def get_trix(self, n=12, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
trix = talib.TRIX(close_array, timeperiod=n)
if array:
return trix
return trix[-1]
# 获取obv指标
def get_obv(self, array=False):
"""
:param array:
:return:
"""
close_array = self.close_array
volume = self.volume
obv = talib.OBV(close_array, volume)
if array:
return obv
return obv[-1]
# 获取vr指标
def get_vr(self, n=26, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
volume = self.volume
vr = talib.VR(close_array, volume, timeperiod=n)
if array:
return vr
return vr[-1]
# 获取cr指标
def get_cr(self, n=26, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
high_list = self.high_list
low_list = self.low_list
cr = talib.NATR(high_list, low_list, close_array, timeperiod=n)
if array:
return cr
return cr[-1]
# 获取dma指标
def get_dma(self, n=10, m=50, array=False):
"""
:param n:
:param m:
:param array:
:return:
"""
close_array = self.close_array
dif = talib.MA(close_array, timeperiod=n) - talib.MA(close_array, timeperiod=m)
dma = dif - talib.MA(dif, timeperiod=10)
if array:
return dma
return dma[-1]
# 获取tma指标
def get_tma(self, n=10, m=10, array=False):
"""
:param n:
:param m:
:param array:
:return:
"""
close_array = self.close_array
tma = talib.MA(talib.MA(close_array, timeperiod=n), timeperiod=m)
if array:
return tma
return tma[-1]
# 获取ema指标
def get_ema(self, n=10, array=False):
"""
:param n:
:param array:
:return:
"""
close_array = self.close_array
ema = talib.EMA(close_array, timeperiod=n)
if array:
return ema
return ema[-1]
# 获取sma指标
def get_sma(self, n=10, array=False):
2、rsi指标是什么意思
1、分析RSI指标的位置:在用RSI指标分析行情时通常以50作为强弱市场分水岭,RSI指标在80识重脱触心根引故元以上为超买区,在20以下为超卖区。RSI大于50为强势市场,小于50为弱势市场。
2、分析RSI的形态:头肩顶、双重顶等顶部形态是卖哥陈敌飞有唱员须友反出信号,双重低、多重低是卖出信号,卖出信号如果在超买区、买入信号如果在你乐龙被丝术超卖区,那么可以进一步加强预判。
3、看纸马扩护余价承出RSI指标的背离:顶背离是卖出信号,底背离是买入信号,当价格越走越高,而RSI指标线却持续走伟考成永容名谁手永低时,可以视作顶背离;反之,当客妈解可队价格越走越低,而RSI指标线却持续走高时,可以视作底背离。
4、看RSI的交叉:当短期的RSI向上穿越长期的RSI时属于金叉,为买入信号;当短期的RSI向下穿越长期齐好留海陈局委停有读的RSI时属于死叉,为卖出信号。
3、rsi指标三条线使用技巧
RSI:相对强弱指标 RSI1,白线,一般是6日相对强弱指标 RSI2,黄线, 一般是12日相对强弱指标RSI3,紫线,一般是24日相对强弱指标。强弱指标的计算公式如下:RSI=100×RS/(1+RS) 或者,RSI=100-100÷(1+RS)其中 RS=14天内收市价上涨数之和的平均值/14天内收市价下跌数之和的平均值RSI下限为0,上限为100,50是RSI的中轴线,即多、空双方的分界线。50以上为强势区(多方市场),50以下为弱势区(空方市场),20以下为超卖区,80以上为超买区。
RSI指标的买点:
(1)W形或头肩底 当RSI在低位或底部形成W形或头肩底形时,属最佳买入时期。
(2)20以下 当RSI运行到20以下时,即进入了超卖区,很容易产生返弹。
(3)金叉 当短期的RSI向上穿越长天期的RSI时为买入信号。
(4)底背离 当股指或股价一波比一波低,而RSI却一波比一波高,叫底背离,此时股指或股价很容易反转上涨。
RSI指标的卖点:
(1)形态 M形、头肩顶形 当RSI在高位或顶部形成M形或头肩顶形时,属最佳卖出时机。
(2)80以上 当RSI运行到80以上时,即进入了超买区,股价很容易下跌。
(3)顶背离 当股指或股价创新高时,而RSI却不创新高,叫顶背离,将是最佳卖出时机。
(4)死叉 当短天期RSI下穿长天期RSI时,叫死叉, 为卖出信号。
支持一下感觉挺不错的