江丰鱼首创新算法九转算法之初步 通达信 主图/副图 源码分享 附图
{九转学习主图源码如下}
SHORT:=12;
LONG:=26;
MID:=9;
HH:=CONST(HHV(H,150));
LL:=CONST(LLV(L,150));
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:=(DIF-DEA)*2,COLORSTICK;
DIF0:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA0:=EMA(DIF0,MID);
MACD0:=(DIF0-DEA0)*2,COLORSTICK;
MHH:=CONST(HHV(MACD0,150));
MLL:=CONST(LLV(DIF0,150));
PY:=(HH-LL)/2+LL;
BFB:=(HH-LL)/(MHH-MLL);
{WWW.GOODGUPIAO.COM}
DIF1:=DIF0*BFB+PY;
DEA1:=EMA(DIF,MID);
MACD1:=DIF1-DEA1;
STICKLINE(MACD>REF(MACD,1)AND MACD>0,PY,PY+MACD,0.5,1),COLORLIRED;
STICKLINE(MACD<0,PY,PY+MACD,0.5,1),COLORLIGREEN;
{九转算法副图源码如下}
KX:=
TOTALBARSCOUNT-CURRBARSCOUNT+1;
C4:=IF(MOD(KX,4)=1,REFX(C,3),IF(MOD(KX,4)=2,REFX(C,2),IF(MOD(KX,4)=3,REFX(C,1),IF(MOD(KX,4)=0,C,DRAWNULL))));{C4 收盘价的模4计算}
MW:=MOD(KX,4)=0;{MW 模位}
KH4:=IF(MW,HHV(H,4),DRAWNULL);
KO4:=IF(MW,REF(O,3),DRAWNULL);
KL4:=IF(MW,LLV(L,4),DRAWNULL);
KC4:=IF(MW,C,DRAWNULL);
DRAWKLINE(KH4,KO4,KL4,KC4);
{WWW.GOODGUPIAO.COM}
QD:=CONST(LLVBARS(L,40));
ZXH:= QD-CURRBARSCOUNT;
KC4Z0:=IF(CURRBARSCOUNT<=QD AND QD>=9*4,CONST(REF(KC4,9*4)),DRAWNULL);
KC4Z1:=IF(CURRBARSCOUNT<=QD AND QD>=8*4,CONST(REF(KC4,8*4)),DRAWNULL);
KC4Z2:=IF(CURRBARSCOUNT<=QD AND QD>=7*4,CONST(REF(KC4,7*4)),DRAWNULL);
KC4Z3:=IF(CURRBARSCOUNT<=QD AND QD>=6*4,CONST(REF(KC4,6*4)),DRAWNULL);
KC4Z4:=IF(CURRBARSCOUNT<=QD AND QD>=5*4,CONST(REF(KC4,5*4)),DRAWNULL);
KC4Z5:=IF(CURRBARSCOUNT<=QD AND QD>=4*4,CONST(REF(KC4,4*4)),DRAWNULL);
KC4Z6:=IF(CURRBARSCOUNT<=QD AND QD>=3*4,CONST(REF(KC4,3*4)),DRAWNULL);
KC4Z7:=IF(CURRBARSCOUNT<=QD AND QD>=2*4,CONST(REF(KC4,2*4)),DRAWNULL);
KC4Z8:=IF(CURRBARSCOUNT<=QD AND QD>=1*4,CONST(REF(KC4,1*4)),DRAWNULL);
KC4Z9:=IF(CURRBARSCOUNT<=QD AND QD>=0*4,CONST(REF(KC4,0*4)),DRAWNULL);
ZS:=IF(KC4Z9<KC4Z8 OR KC4Z8<KC4Z7 OR KC4Z7<KC4Z6 OR KC4Z6<KC4Z5 OR KC4Z5<KC4Z4 OR KC4Z4<KC4Z3 OR KC4Z3<KC4Z2 OR KC4Z2<KC4Z1 OR KC4Z1<KC4Z0,0,1);
{WWW.GOODGUPIAO.COM}
ZXH0:=IF(MOD (INTPART(ZXH/4) ,9)=0,9, MOD (INTPART(ZXH/4) ,9));
DRAWNUMBER(ZS=1,KC4, ZXH0);
未来函数检测结果如下:
该公式包含未来函数:REFX
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
{九转学习主图源码如下}SHORT赋值:12
LONG赋值:26
MID赋值:9
HH赋值:CONST(150日内H最高值)
LL赋值:CONST(150日内L最低值)
DIF赋值:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均
DEA赋值:DIF的MID日指数移动平均
MACD赋值:(DIF-DEA)*2,COLORSTICK
DIF0:=收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均
DEA0:=DIF0的MID日指数移动平均
MACD0:=(DIF0-DEA0)*2,COLORSTICK
MHH赋值:CONST(150日内MACD0最高值)
MLL赋值:CONST(150日内DIF0最低值)
PY赋值:(HH-LL)/2+LL
BFB赋值:(HH-LL)/(MHH-MLL)
{WWW.GOODGUPIAO.COM}DIF1:=DIF0*BFB+PY
DEA1:=DIF的MID日指数移动平均
MACD1:=DIF1-DEA1
STICKLINE(MACD>1日前的MACDAND MACD>0,PY,PY+MACD,0.5,1),COLORLIRED
当满足条件MACD<0时,在PY和PY+MACD之间画柱状线
{九转算法副图源码如下}KX赋值:TOTALBARSCOUNT- 到最后交易的周期+1
C4赋值:IF(MOD(KX,4)=1,REFX(C,3),IF(MOD(KX,4)=2,REFX(C,2),IF(MOD(KX,4)=3,REFX(C,1),IF(MOD(KX,4)=0,C,DRAWNULL))))
{C4 收盘价的模4计算}MW:=MOD(KX,4)=0
{MW 模位}KH4赋值:IF(MW,4日内H最高值,DRAWNULL)
KO4赋值:IF(MW,3日前的O,DRAWNULL)
KL4赋值:IF(MW,4日内L最低值,DRAWNULL)
如果MW返回C否则返回DRAWNULL
DRAWKLINE(KH4,KO4,KL4,KC4)
{WWW.GOODGUPIAO.COM}QD赋值:CONST(LLVBARS(L,40))
ZXH赋值: QD- 到最后交易的周期
KC4Z0:=IF( 到最后交易的周期<=QD AND QD>=9*4,CONST(9*4日前的KC4),DRAWNULL)
KC4Z1:=IF( 到最后交易的周期<=QD AND QD>=8*4,CONST(8*4日前的KC4),DRAWNULL)
KC4Z2:=IF( 到最后交易的周期<=QD AND QD>=7*4,CONST(7*4日前的KC4),DRAWNULL)
KC4Z3:=IF( 到最后交易的周期<=QD AND QD>=6*4,CONST(6*4日前的KC4),DRAWNULL)
KC4Z4:=IF( 到最后交易的周期<=QD AND QD>=5*4,CONST(5*4日前的KC4),DRAWNULL)
KC4Z5:=IF( 到最后交易的周期<=QD AND QD>=4*4,CONST(4*4日前的KC4),DRAWNULL)
KC4Z6:=IF( 到最后交易的周期<=QD AND QD>=3*4,CONST(3*4日前的KC4),DRAWNULL)
KC4Z7:=IF( 到最后交易的周期<=QD AND QD>=2*4,CONST(2*4日前的KC4),DRAWNULL)
KC4Z8:=IF( 到最后交易的周期<=QD AND QD>=1*4,CONST(1*4日前的KC4),DRAWNULL)
KC4Z9:=IF( 到最后交易的周期<=QD AND QD>=0*4,CONST(0*4日前的KC4),DRAWNULL)
如果KC4Z9{WWW.GOODGUPIAO.COM}ZXH0:=IF(MOD (INTPART(ZXH/4) ,9)=0,9, MOD (INTPART(ZXH/4) ,9))
DRAWNUMBER(ZS=1,KC4, ZXH0)