提供技术分析指标接口介绍及使用方法
(温馨提示:鉴于内容太多, 可使用Ctrl + F
进行搜索)
感谢您使用量化回测平台,如果有使用问题,请您通过邮件的方式告诉我们,谢谢。
客服热线:0571-26695555-2-1
邮箱:service.PBOX@hundsun.com
我们基于通达信、东方财富、同花顺等的公式,提供更多技术分析指标因子
下文给出了详细介绍包括公式的API、参数说明、返回值的结果及类型说明、备注(相较于上述三家结果及算法的比对)、用法注释及示例,旨在帮助您更方便、更快速的在策略研究中使用这些因子函数。
ACCER(security_list, check_date, N = 8)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 ACCER 值
ACCER1 = ACCER(security_list1, check_date='20170104', N = 8)
print(ACCER1[security_list1])
# 输出 security_list2 的 ACCER 值
ACCER2 = ACCER(security_list2, check_date='20170104', N = 8)
for stock in security_list2:
print(ACCER2[stock])
ADTM(security_list, check_date, N = 23, M = 8)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 ADTM 值
ADTM1, MAADTM1 = ADTM(security_list1, check_date='20170104', N = 23, M = 8)
print(ADTM1[security_list1])
print(MAADTM1[security_list1])
# 输出 security_list2 的 ADTM 值
ADTM2, MAADTM2 = ADTM(security_list2, check_date='20170104', N = 23, M = 8)
for stock in security_list2:
print(ADTM2[stock])
print(MAADTM2[stock])
BIAS_QL(security_list, check_date, N = 6, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 BIAS_QL 值
BIAS1, BIASMA1 = BIAS_QL(security_list1, check_date = '20170104', N = 6, M = 6)
print(BIAS1[security_list1])
print(BIASMA1[security_list1])
# 输出 security_list2 的 BIAS_QL 值
BIAS2, BIASMA2 = BIAS_QL(security_list2, check_date = '20170104', N = 6, M = 6)
for stock in security_list2:
print(BIAS2[stock])
print(BIASMA2[stock])
BIAS36(security_list, check_date, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 BIAS36 值
BIAS36_1, BIAS612_1, ABIAS_1 = BIAS36(security_list1, check_date='20170104', M = 6)
print(BIAS36_1[security_list1])
print(BIAS612_1[security_list1])
print(ABIAS_1[security_list1])
# 输出 security_list2 的 BIAS36 值
BIAS36_2, BIAS612_2, ABIAS_2 = BIAS36(security_list2, check_date='20170104', M = 6)
for stock in security_list2:
print(BIAS36_2[stock])
print(BIAS612_2[stock])
print(ABIAS_2[stock])
DKX(security_list, check_date, M = 10)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 DKX 值
DKX1,MADKX1 = DKX(security_list1, check_date='20170104', M = 10)
print(DKX1[security_list1])
print(MADKX1[security_list1])
# 输出 security_list2 的 DKX 值
DKX2,MADKX2 = DKX(security_list2, check_date='20170104', M = 10)
for stock in security_list2:
print(DKX2[stock])
print(MADKX2[stock])
KD(security_list, check_date, N = 9, M1 = 3, M2 = 3)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 KD值
K1, D1 = KD(security_list1, check_date = '20170104', N = 9, M1 = 3, M2 = 3)
print(K1[security_list1])
print(D1[security_list1])
# 输出 security_list2 的 KD 值
K2, D2 = KD(security_list2, check_date = '20170104', N = 9, M1 = 3, M2 = 3)
for stock in security_list2:
print(K2[stock])
print(D2[stock])
SKDJ(security_list, check_date, N = 9, M = 3)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 SKDJ 值
K1, D1 = SKDJ(security_list1, check_date = '20170104', N = 9, M = 3)
print(K1[security_list1])
print(D1[security_list1])
# 输出 security_list2 的 SKDJ 值
K2, D2 = SKDJ(security_list2, check_date = '20170104', N = 9, M = 3)
for stock in security_list2:
print(K2[stock])
print(D2[stock])
MFI(security_list, check_date, N = 14)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.MFI>80 为超买,当其回头向下跌破80 时,为短线卖出时机;
2.MFI<20 为超卖,当其回头向上突破20 时,为短线买进时机;
3.MFI>80,而产生背离现象时,视为卖出信号;
4.MFI<20,而产生背离现象时,视为买进信号。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 MFI 值
MFI1 = MFI(security_list1,check_date='20170104', N = 14)
print(MFI1[security_list1])
# 输出 security_list2 的 MFI 值
MFI2 = MFI(security_list2,check_date='20170104', N = 14)
for stock in security_list2:
print(MFI2[stock])
MTM(security_list, check_date, N = 12, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
MTM线 :当日收盘价与N日前的收盘价的差;
MTMMA线:对上面的差值求N日移动平均;
参数:N 间隔天数,也是求移动平均的天数,一般取6用法:
1.MTM从下向上突破MTMMA,买入信号;
2.MTM从上向下跌破MTMMA,卖出信号;
3.股价续创新高,而MTM未配合上升,意味上涨动力减弱;
4.股价续创新低,而MTM未配合下降,意味下跌动力减弱;
5.股价与MTM在低位同步上升,将有反弹行情;反之,从高位同步下降,将有回落走势。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 MTM 值
MTM_MTM, MTM_MTMMA = MTM(security_list1,check_date='20170104', N = 12, M = 6)
print(MTM_MTM[security_list1])
print(MTM_MTMMA[security_list1])
# 输出 security_list2 的 MTM 值
MTM_MTM, MTM_MTMMA = MTM(security_list2,check_date='20170104', N = 12, M = 6)
for stock in security_list2:
print(MTM_MTM[stock])
print(MTM_MTMMA[stock])
ROC(security_list, check_date, N = 12, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.本指标的超买超卖界限值随个股不同而不同,使用者应自行调整;
2.本指标的超买超卖范围,一般介于±6.5之间;
3.本指标用法请参考MTM 指标用法;
4.本指标可设参考线。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 ROC 值
ROC_ROC, ROC_MAROC = ROC(security_list1,check_date='20170104', N = 12, M = 6)
print(ROC_ROC[security_list1])
print(ROC_MAROC[security_list1])
# 输出 security_list2 的 ROC 值
ROC_ROC, ROC_MAROC = ROC(security_list2,check_date='20170104', N = 12, M = 6)
for stock in security_list2:
print(ROC_ROC[stock])
print(ROC_MAROC[stock])
MARSI(security_list, check_date, M1 = 10, M2 = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 MARSI 值
RSI10_1, RSI6_1 = MARSI(security_list1, check_date = '20170104', M1 = 10, M2 = 6)
print(RSI10_1[security_list1])
print(RSI6_1[security_list1])
# 输出 security_list2 的 MARSI 值
RSI10_2, RSI6_2 = MARSI(security_list2, check_date = '20170104', M1 = 10, M2 = 6)
for stock in security_list2:
print(RSI10_2[stock])
print(RSI6_2[stock])
OSC(security_list, check_date, N = 20, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 OSC 值
OSC1, MAOSC1 = OSC(security_list1, check_date = '20170104', N = 20, M = 6)
print(OSC1[security_list1])
print(MAOSC1[security_list1])
# 输出 security_list2 的 OSC 值
OSC2, MAOSC2 = OSC(security_list2, check_date = '20170104', N = 20, M = 6)
for stock in security_list2:
print(OSC2[stock])
print(MAOSC2[stock])
UDL(security_list, check_date, N1 = 3, N2 = 5, N3 = 10, N4 = 20, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 UDL 值
UDL1, MAUDL1 = UDL(security_list1, check_date = '20170104', N1 = 3, N2 = 5, N3 = 10, N4 = 20, M = 6)
print(UDL1[security_list1])
print(MAUDL1[security_list1])
# 输出 security_list2 的 UDL 值
UDL2, MAUDL2 = UDL(security_list2, check_date = '20170104', N1 = 3, N2 = 5, N3 = 10, N4 = 20, M = 6)
for stock in security_list2:
print(UDL2[stock])
print(MAUDL2[stock])
WR(security_list, check_date, N = 10, N1 = 6)
参数:
返回:
返回结果类型:
备注:
方法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 WR 值
WR1, MAWR1 = WR(security_list1, check_date = '20170104', N = 10, N1 = 6)
print(WR1[security_list1])
print(MAWR1[security_list1])
# 输出 security_list2 的 WR 值
WR2, MAWR2 = WR(security_list2, check_date = '20170104', N = 10, N1 = 6)
for stock in security_list2:
print(WR2[stock])
print(MAWR2[stock])
LWR(security_list, check_date, N = 9, M1 = 3, M2 = 3)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 LWR 值
LWR1, LWR2 = LWR(security_list1, check_date = '20170104', N = 9, M1 = 3, M2 = 3)
print(LWR1[security_list1])
print(LWR2[security_list1])
# 输出 security_list2 的 LWR 值
LWR1, LWR2 = LWR(security_list2, check_date = '20170104', N = 9, M1 = 3, M2 = 3)
for stock in security_list2:
print(LWR1[stock])
print(LWR2[stock])
CHO(security_list, check_date, N1 = 10, N2 = 20, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.CHO 曲线产生急促的「凸起」时,代表行情即将向上或向下反转;
2.股价>90 天平均线,CHO由负转正时,买进;
3.股价<90 天平均线,CHO由正转负时,卖出;
4.本指标也可设参考线,自定超买超卖的界限值;
5.本指标须配合OBOS、ENVELOPE同时使用。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 CHO 值
CHO1,MACHO1 = CHO(security_list1,check_date='20170104', N1 = 10, N2 = 20, M = 6)
print(CHO1[security_list1])
print(MACHO1[security_list1])
# 输出 security_list2 的 CHO 值
CHO2,MACHO2 = CHO(security_list2,check_date='20170104', N1 = 10, N2 = 20, M = 6)
for stock in security_list2:
print(CHO2[stock])
print(MACHO2[stock])
CYE(security_list, check_date)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 CYE 值
CYEL1,CYES1 = CYE(security_list1,check_date='20170104')
print(CYEL1[security_list1])
print(CYES1[security_list1])
# 输出 security_list2 的 CYE 值
CYEL2,CYES2 = CYE(security_list2,check_date='20170104')
for stock in security_list2:
print(CYEL2[stock])
print(CYES2[stock])
DMA(security_list, check_date, N1 = 10, N2 = 50, M = 10)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.DMA 向上交叉其平均线时,买进;
2.DMA 向下交叉其平均线时,卖出;
3.DMA 的交叉信号比MACD、TRIX 略快;
4.DMA 与股价产生背离时的交叉信号,可信度较高;
5.DMA、MACD、TRIX 三者构成一组指标群,互相验证。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 DMA 值
DIF1,DIFMA1 = DMA(security_list1,check_date='20170104', N1 = 10, N2 = 50, M = 10)
print(DIF1[security_list1])
print(DIFMA1[security_list1])
# 输出 security_list2 的 DMA 值
DIF2,DIFMA2 = DMA(security_list2,check_date='20170104', N1 = 10, N2 = 50, M = 10)
for stock in security_list2:
print(DIF2[stock])
print(DIFMA2[stock])
DMI(security_list, check_date, N=14, M = 6):
参数:
返回:
返回结果类型:
备注:
用法注释:
用法:市场行情趋向明显时,指标效果理想。
PDI(上升方向线) MDI(下降方向线) ADX(趋向平均值)
1.PDI线从下向上突破MDI线,显示有新多头进场,为买进信号;
2.PDI线从上向下跌破MDI线,显示有新空头进场,为卖出信号;
3.ADX值持续高于前一日时,市场行情将维持原趋势;
4.ADX值递减,降到20以下,且横向行进时,市场气氛为盘整;
5.ADX值从上升倾向转为下降时,表明行情即将反转。
参数:N 统计天数; M 间隔天数,一般为14、6
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 DMI 值
dmi_pdi, dmi_mdi, dmi_adx, dmi_adxr = DMI(security_list1,check_date='20170104', N= 14, M = 6)
print(dmi_pdi[security_list1])
print(dmi_mdi[security_list1])
print(dmi_adx[security_list1])
print(dmi_adxr[security_list1])
# 输出 security_list2 的 DMI 值
dmi_pdi, dmi_mdi, dmi_adx, dmi_adxr = DMI(security_list2,check_date='20170104', N= 14, M = 6)
for stock in security_list2:
print(dmi_pdi[stock])
print(dmi_mdi[stock])
print(dmi_adx[stock])
print(dmi_adxr[stock])
DPO(security_list, check_date, N=20, M = 6):
参数:
返回:
返回结果类型:
备注:
用法注释:
1.DOP>0 ,表示目前处于多头市场;DOP<0 ,表示目前处于空头市场;
2.在0 轴上方设定一条超买线,当股价波动至超买线时,会形成短期高点;
3.在0 轴下方设定一条超卖线,当股价波动至超卖线时,会形成短期低点;
4.超买超卖的范围随个股不同而不同,使用者应自行调整;
5.本指标可设参考线。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 DPO 值
DPO1,MADPO1 = DPO(security_list1,check_date='20170104', N= 20, M = 6)
print(DPO1[security_list1])
print(MADPO1[security_list1])
# 输出 security_list2 的 DPO 值
DPO2,MADPO2 = DPO(security_list2,check_date='20170104', N= 20, M = 6)
for stock in security_list2:
print(DPO2[stock])
print(MADPO2[stock])
EMV(security_list, check_date, N = 14, M = 9)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.EMV 由下往上穿越0 轴时,视为中期买进信号;
2.EMV 由上往下穿越0 轴时,视为中期卖出信号;
3.EMV 的平均线穿越0 轴,产生假信号的机会较少;
4.当ADX 低于±DI时,本指标失去效用;
5.须长期使用EMV 指标才能获得最佳利润。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 EMV 值
EMV1,MAEMV1 = EMV(security_list1,check_date='20170104', N = 14, M = 9)
print(EMV1[security_list1])
print(MAEMV1[security_list1])
# 输出 security_list2 的 EMV 值
EMV2,MAEMV2 = EMV(security_list2,check_date='20170104', N = 14, M = 9)
for stock in security_list2:
print(EMV2[stock])
print(MAEMV2[stock])
GDX(security_list, check_date, N = 30, M = 9)
参数:
返回:
返回结果类型:
备注:
用法注释:
通道理论公式,是一种用技术手段和经验判断来决定买卖股票的方法。该公式对趋势线做了平滑和修正处理,更精确的反应了股价运行规律。当股价上升到压力线时,投资者就卖出股票,而当股价下跌到支撑线时,投资者就进行相应的补进。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 GDX 值
gdx_jax, gdx_ylx, gdx_zcx = GDX(security_list1,check_date='20170104', N = 30, M = 9)
print(gdx_jax[security_list1])
print(gdx_ylx[security_list1])
print(gdx_zcx[security_list1])
# 输出 security_list2 的 GDX 值
gdx_jax, gdx_ylx, gdx_zcx = GDX(security_list2,check_date='20170104', N = 30, M = 9)
for stock in security_list2:
print(gdx_jax[stock])
print(gdx_ylx[stock])
print(gdx_zcx[stock])
JLHB(security_list, check_date, N = 7, M = 5)
参数:
返回:
返回结果类型:
备注:
用法注释:
反趋势类选股指标。综合了动量观念、强弱指标与移动平均线的优点,在计算过程中主要研究高低价位与收市价的关系,反映价格走势的强弱和超买超卖现象。在市场短期超买超卖的预测方面又较敏感。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 JLHB 值
jlhb_b, jlhb_var2, jlhb_jlhb = JLHB(security_list1,check_date='20170104', N = 7, M = 5)
print(jlhb_b[security_list1])
print(jlhb_var2[security_list1])
print(jlhb_jlhb[security_list1])
# 输出 security_list2 的 JLHB 值
jlhb_b, jlhb_var2, jlhb_jlhb = JLHB(security_list2,check_date='20170104', N = 7, M = 5)
for stock in security_list2:
print(jlhb_b[stock])
print(jlhb_var2[stock])
print(jlhb_jlhb[stock])
JS(security_list, check_date, N = 5, M1 = 5, M2 = 10, M3 = 20)
参数:
返回:
返回结果类型:
备注:
用法注释:
加速线指标是衡量股价涨速的工具,加速线指标上升表明股价上升动力增加,加速线指标下降表明股价下降压力增加。
加速线适用于DMI表明趋势明显时(DMI.ADX大于20)使用:
1.如果加速线在0值附近形成平台,则表明既不是最好的买入时机也不是最好的卖入时机;
2.在加速线发生金叉后,均线形成底部是买入时机;
3.在加速线发生死叉后,均线形成顶部是卖出时机;
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 JS 值
js_jsx, js_majsx1, js_majsx2, js_majsx3 = JS(security_list1,check_date='20170104', N = 5, M1 = 5, M2 = 10, M3 = 20)
print(js_jsx[security_list1])
print(js_majsx1[security_list1])
print(js_majsx2[security_list1])
print(js_majsx3[security_list1])
# 输出 security_list2 的 JS 值
js_jsx, js_majsx1, js_majsx2, js_majsx3 = JS(security_list2,check_date='20170104', N = 5, M1 = 5, M2 = 10, M3 = 20)
for stock in security_list2:
print(js_jsx[stock])
print(js_majsx1[stock])
print(js_majsx2[stock])
print(js_majsx3[stock])
QACD(security_list, check_date, N1 = 12, N2 = 26, M = 9)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.DIF 向上交叉MACD,买进;DIF 向下交叉MACD,卖出;
2.DIF 连续两次向下交叉MACD,将造成较大的跌幅;
3.DIF 连续两次向上交叉MACD,将造成较大的涨幅;
4.DIF 与股价形成背离时所产生的信号,可信度较高;
5.DMA、MACD、TRIX 三者构成一组指标群,互相验证。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 QACD 值
qacd_dif, qacd_macd, qacd_ddif = QACD(security_list1,check_date='20170104', N1 = 12, N2 = 26, M = 9)
print(qacd_dif[security_list1])
print(qacd_macd[security_list1])
print(qacd_ddif[security_list1])
# 输出 security_list2 的 QACD 值
qacd_dif, qacd_macd, qacd_ddif = QACD(security_list2,check_date='20170104', N1 = 12, N2 = 26, M = 9)
for stock in security_list2:
print(qacd_dif[stock])
print(qacd_macd[stock])
print(qacd_ddif[stock])
UOS(security_list, check_date, N1 = 7, N2 = 14, N3 = 28, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.UOS 上升至50~70的间,而后向下跌破其N字曲线低点时,为短线卖点;
2.UOS 上升超过70以上,而后向下跌破70时,为中线卖点;
3.UOS 下跌至45以下,而后向上突破其N字曲线高点时,为短线买点;
4.UOS 下跌至35以下,产生一底比一底高的背离现象时,为底部特征;
5.以上各项数据会因个股不同而略有不同,请利用参考线自行修正。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的UOS值
uos_ultiInc, uos_mauos = UOS(security_list1,check_date='20170104', N1 = 7, N2 = 14, N3 = 28, M = 6)
print(uos_ultiInc[security_list1])
print(uos_mauos[security_list1])
# 输出 security_list2 的 UOS 值
uos_ultiInc, uos_mauos = UOS(security_list2,check_date='20170104', N1 = 7, N2 = 14, N3 = 28, M = 6)
for stock in security_list2:
print(uos_ultiInc[stock])
print(uos_mauos[stock])
VMACD(security_list, check_date, SHORT = 12, LONG = 26, MID = 9)
参数:
返回:
返回结果类型:
备注:
用法注释:
基于成交量的MACD算法。
用法:
1.DIFF、DEA均为正,DIFF向上突破DEA,买入信号。
2.DIFF、DEA均为负,DIFF向下跌破DEA,卖出信号。
3.DEA线与K线发生背离,行情反转信号。
4.分析MACD柱状线,由红变绿(正变负),卖出信号;由绿变红,买入信号
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的VMACD值
vmacd_dif, vmacd_dea, vmacd_macd = VMACD(security_list1,check_date='20170104', SHORT = 12, LONG = 26, MID = 9)
print(vmacd_dif[security_list1])
print(vmacd_dea[security_list1])
print(vmacd_macd[security_list1])
# 输出 security_list2 的 VMACD 值
vmacd_dif, vmacd_dea, vmacd_macd = VMACD(security_list2,check_date='20170104', SHORT = 12, LONG = 26, MID = 9)
for stock in security_list2:
print(vmacd_dif[stock])
print(vmacd_dea[stock])
print(vmacd_macd[stock])
VPT(security_list, check_date, N = 51, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.VPT 由下往上穿越0 轴时,为买进信号;
2.VPT 由上往下穿越0 轴时,为卖出信号;
3.股价一顶比一顶高,VPT 一顶比一顶低时,暗示股价将反转下跌;
4.股价一底比一底低,VPT 一底比一底高时,暗示股价将反转上涨;
5.VPT 可搭配EMV 和WVAD指标使用效果更佳。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
VPT_VPT, VPT_MAVPT = VPT(security_list1, check_date='20170104', N= 51, M = 6)
print(VPT_VPT[security_list1])
print(VPT_MAVPT[security_list1])
# 输出 security_list2 的 VPT 值
VPT_VPT, VPT_MAVPT = VPT(security_list2, check_date='20170104', N= 51, M = 6)
for stock in security_list2:
print(VPT_VPT[stock])
print(VPT_MAVPT[stock])
WVAD(security_list, check_date, N = 24, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.WVAD由下往上穿越0 轴时,视为长期买进信号;
2.WVAD由上往下穿越0 轴时,视为长期卖出信号;
3.当ADX 低于±DI时,本指标失去效用;
4.长期使用WVAD指标才能获得最佳利润;
5.本指标可与EMV 指标搭配使用。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 WVAD 值
wvad_wvad, wvad_mawvad = WVAD(security_list1,check_date='20170104', N = 24, M = 6)
print(wvad_wvad[security_list1])
print(wvad_mawvad[security_list1])
# 输出 security_list2 的 WVAD 值
wvad_wvad, wvad_mawvad = WVAD(security_list2,check_date='20170104', N = 24, M = 6)
for stock in security_list2:
print(wvad_wvad[stock])
print(wvad_mawvad[stock])
BRAR(security_list, check_date, N=26)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 BRAR 值
BR1,AR1 = BRAR(security_list1, check_date='20170104', N=26)
print(BR1[security_list1])
print(AR1[security_list1])
# 输出 security_list2 的 BRAR 值
BR2,AR2 = BRAR(security_list2, check_date='20170104', N=26)
for stock in security_list2:
print(BR2[stock])
print(AR2[stock])
CR(security_list, check_date, N=26, M1=10, M2=20, M3=40, M4=62)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 CR 值
CR1, MA1, MA2, MA3, MA4 = CR(security_list1, check_date='20170104', N=26, M1=10, M2=20, M3=40, M4=62)
print(CR1[security_list1])
print(MA1[security_list1])
print(MA2[security_list1])
print(MA3[security_list1])
print(MA4[security_list1])
# 输出 security_list2 的 CR 值
CR1, MA1, MA2, MA3, MA4 = CR(security_list2, check_date='20170104', N=26, M1=10, M2=20, M3=40, M4=62)
for stock in security_list2:
print(CR1[stock])
print(MA1[stock])
print(MA2[stock])
print(MA3[stock])
print(MA4[stock])
CYR(security_list, check_date, N = 13, M = 5)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 CYR 值
CYR1,MACYR1 = CYR(security_list1, check_date='20170104', N = 13, M = 5)
print(CYR1[security_list1])
print(MACYR1[security_list1])
# 输出 security_list2 的 CYR 值
CYR2,MACYR2 = CYR(security_list2, check_date='20170104', N = 13, M = 5)
for stock in security_list2:
print(CYR2[stock])
print(MACYR2[stock])
MASS(security_list, check_date, N1=9, N2=25, M=6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 MASS 值
MASS1,MAMASS1 = MASS(security_list1, check_date='20170104', N1=9, N2=25, M=6)
print(MASS1[security_list1])
print(MAMASS1[security_list1])
# 输出 security_list2 的 MASS 值
MASS2,MAMASS2 = MASS(security_list2, check_date='20170104', N1=9, N2=25, M=6)
for stock in security_list2:
print(MASS2[stock])
print(MAMASS2[stock])
PCNT(security_list, check_date, M = 5)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 PCNT 值
PCNT1,MAPCNT1 = PCNT(security_list1, check_date='20170104', M=5)
print(PCNT1[security_list1])
print(MAPCNT1[security_list1])
# 输出 security_list2 的 PCNT 值
PCNT2,MAPCNT2 = PCNT(security_list2, check_date='20170104', M=5)
for stock in security_list2:
print(PCNT2[stock])
print(MAPCNT2[stock])
PSY(security_list, check_date, N = 12, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.PSY>75,形成M头时,股价容易遭遇压力;
2.PSY<25,形成W底时,股价容易获得支撑;
3.PSY 与VR 指标属一组指标群,须互相搭配使用。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 PSY 值
PSY_PSY, PSY_PSYMA = PSY(security_list1,check_date='20170104', N = 12, M = 6)
print(PSY_PSY[security_list1])
print(PSY_PSYMA[security_list1])
# 输出 security_list2 的 PSY 值
PSY_PSY, PSY_PSYMA = PSY(security_list2,check_date='20170104', N = 12, M = 6)
for stock in security_list2:
print(PSY_PSY[stock])
print(PSY_PSYMA[stock])
VR(security_list, check_date, N=26, M=6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 VR 值
VR1,MAVR1 = VR(security_list1, check_date='20170104', N=26, M=6)
print(VR1[security_list1])
print(MAVR1[security_list1])
# 输出 security_list2 的 VR 值
VR2,MAVR2 = VR(security_list2, check_date='20170104', N=26, M=6)
for stock in security_list2:
print(VR2[stock])
print(MAVR2[stock])
AMO(security_list, check_date, M1 = 5, M2 = 10)
参数:
返回:
- AMOW,AMO1和AMO2 的值
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 AMO 值
AMOW,AMO1,AMO2 = AMO(security_list1, check_date='20170104', M1 = 5, M2 = 10)
print(AMOW[security_list1])
print(AMO1[security_list1])
print(AMO2[security_list1])
# 输出 security_list2 的 AMO 值
AMOW,AMO1,AMO2 = AMO(security_list2, check_date='20170104', M1 = 5, M2 = 10)
for stock in security_list2:
print(AMOW[stock])
print(AMO1[stock])
print(AMO2[stock])
OBV(security_list, check_date, N = 30)
参数:
返回:
返回结果类型:
备注:
用法注释:
1.股价一顶比一顶高,而OBV 一顶比一顶低,暗示头部即将形成;
2.股价一底比一底低,而OBV 一底比一底高,暗示底部即将形成;
3.OBV 突破其N字形波动的高点次数达5 次时,为短线卖点;
4.OBV 跌破其N字形波动的低点次数达5 次时,为短线买点;
5.OBV 与ADVOL、PVT、WAD、ADL同属一组指标群,使用时应综合研判。
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 OBV 值
OBV1 = OBV(security_list1,check_date='20170104', N = 30)
print(OBV1[security_list1])
# 输出 security_list2 的 OBV 值
OBV2 = OBV(security_list2,check_date='20170104', N = 30)
for stock in security_list2:
print(OBV2[stock])
VOL(security_list, check_date, M1=5, M2=10)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 VOL 值
VOL1,MAVOL11,MAVOL12 = VOL(security_list1, check_date='20170104', M1=5, M2=10)
print(VOL1[security_list1])
print(MAVOL11[security_list1])
print(MAVOL12[security_list1])
# 输出 security_list2 的 VOL 值
VOL2,MAVOL21,MAVOL22 = VOL(security_list2, check_date='20170104', M1=5, M2=10)
for stock in security_list2:
print(VOL2[stock])
print(MAVOL21[stock])
print(MAVOL22[security_list1])
VRSI(security_list, check_date, N1=6, N2=12, N3=24)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 VRSI 值
VRSI1,VRSI2,VRSI3 = VRSI(security_list1, check_date='20170104', N1=6, N2=12, N3=24)
print(VRSI1[security_list1])
print(VRSI2[security_list1])
print(VRSI3[security_list1])
# 输出 security_list2 的 VRSI 值
VRSI1,VRSI2,VRSI3 = VRSI(security_list2, check_date='20170104', N1=6, N2=12, N3=24)
for stock in security_list2:
print(VRSI1[stock])
print(VRSI2[stock])
print(VRSI3[stock])
AMV(security_list, check_date, M = 13)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 AMV 值
AMV1 = AMV(security_list1,check_date='20170104', M=13)
print(AMV1[security_list1])
# 输出 security_list2 的 AMV 值
AMV2 = AMV(security_list2,check_date='20170104', M=13)
for stock in security_list2:
print(AMV2[stock])
ALLIGAT(security_list, check_date)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 ALLIGAT 值
up1, teeth1, down1 = ALLIGAT(security_list1,check_date='20170104')
print(up1[security_list1])
print(teeth1[security_list1])
print(down1[security_list1])
# 输出 security_list2 的 ALLIGAT 值
up2, teeth2, down2 = ALLIGAT(security_list2,check_date='20170104')
for stock in security_list2:
print(up2[stock])
print(teeth2[stock])
print(down2[stock])
EXPMA(security_list, check_date, N = 12)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 EXPMA 值
EXPMA1 = EXPMA(security_list1,check_date='20170104', N = 12)
print(EXPMA1[security_list1])
# 输出 security_list2 的 EXPMA 值
EXPMA2 = EXPMA(security_list2,check_date='20170104', N = 12)
for stock in security_list2:
print(EXPMA2[stock])
BBIBOLL(security_list, check_date, N = 11, M = 6)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 BBIBOLL 值
bbi1, upr1, dwn1 = BBIBOLL(security_list1,check_date='20170104', N = 11, M = 6)
print(bbi1[security_list1])
print(upr1[security_list1])
print(dwn1[security_list1])
# 输出 security_list2 的 BBIBOLL 值
bbi2, upr2, dwn2 = BBIBOLL(security_list2,check_date='20170104', N = 11, M = 6)
for stock in security_list2:
print(bbi2[stock])
print(upr2[stock])
print(dwn2[stock])
HMA(security_list, check_date, N = 12)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 HMA 值
HMA1 = HMA(security_list1,check_date='20170104', N = 12)
print(HMA1[security_list1])
# 输出 security_list2 的 HMA 值
HMA2 = HMA(security_list2,check_date='20170104', N = 12)
for stock in security_list2:
print(HMA2[stock])
LMA(security_list, check_date, N = 12)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 LMA 值
LMA1 = LMA(security_list1,check_date='20170104', N = 12)
print(LMA1[security_list1])
# 输出 security_list2 的 LMA 值
LMA2 = LMA(security_list2,check_date='20170104', N = 12)
for stock in security_list2:
print(LMA2[stock])
VMA(security_list, check_date, N = 12)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 VMA 值
VMA1 = VMA(security_list1,check_date='20170104', N = 12)
print(VMA1[security_list1])
# 输出 security_list2 的 VMA 值
VMA2 = VMA(security_list2,check_date='20170104', N = 12)
for stock in security_list2:
print(VMA2[stock])
ENE(security_list,check_date,N=25,M1=6,M2=6):
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 ENE 值
up1, low1, ENE1 = ENE(security_list1,check_date='20170104',N=25,M1=6,M2=6)
print(up1[security_list1])
print(low1[security_list1])
print(ENE1[security_list1])
# 输出 security_list2 的 ENE 值
up2, low2, ENE2 = ENE(security_list2,check_date='20170104',N=25,M1=6,M2=6)
for stock in security_list2:
print(up2[stock])
print(low2[stock])
print(ENE2[stock])
MIKE(security_list, check_date, N = 10)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 MIKE 值
stor1, midr1, wekr1, weks1, mids1, stos1 = MIKE(security_list1,check_date='20170104', N = 10)
print(stor1[security_list1])
print(midr1[security_list1])
print(wekr1[security_list1])
print(weks1[security_list1])
print(mids1[security_list1])
print(stos1[security_list1])
# 输出 security_list2 的 MIKE 值
stor2, midr2, wekr2, weks2, mids2, stos2 = MIKE(security_list2,check_date='20170104', N = 10)
for stock in security_list2:
print(stor2[stock])
print(midr2[stock])
print(wekr2[stock])
print(weks2[stock])
print(mids2[stock])
print(stos2[stock])
PBX(security_list, check_date, N = 9)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 PBX 值
PBX1 = PBX(security_list1,check_date='20170104', N = 9)
print(PBX1[security_list1])
# 输出 security_list2 的 PBX 值
PBX2 = PBX(security_list2,check_date='20170104', N = 9)
for stock in security_list2:
print(PBX2[stock])
XS(security_list, check_date, N = 13)
参数:
返回:
返回结果类型:
备注:
用法注释:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 XS 值
sup1, sdn1, lup1, ldn1 = XS(security_list1,check_date='20170104', N = 13)
print(sup1[security_list1])
print(sdn1[security_list1])
print(lup1[security_list1])
print(ldn1[security_list1])
# 输出 security_list2 的 XS 值
sup2, sdn2, lup2, ldn2 = XS(security_list2,check_date='20170104', N = 13)
for stock in security_list2:
print(sup2[stock])
print(sdn2[stock])
print(lup2[stock])
print(ldn2[stock])
XS2(security_list, check_date, N = 102, M = 7)
参数:
返回:
返回结果类型:
备注:
用法注释:
特点:
用法:
示例:
# 定义股票池列表
security_list1 = '000001.XSHE'
security_list2 = ['000001.XSHE','000002.XSHE','601211.XSHG','603177.XSHG']
# 计算并输出 security_list1 的 XS2 值
pass1, pass2, pass3, pass4 = XS2(security_list1,check_date='20170104',N=102,M=7)
print(pass1[security_list1])
print(pass2[security_list1])
print(pass3[security_list1])
print(pass4[security_list1])
# 输出 security_list2 的 XS2 值
pass_1, pass_2, pass_3, pass_4 = XS2(security_list2,check_date='20170104', N=102,M=7)
for stock in security_list2:
print(pass_1[stock])
print(pass_2[stock])
print(pass_3[stock])
print(pass_4[stock])