复杂的指标简单的线,生命通道主图源码,说明
本指标含有飞狐特有函数MD,指标内容虽然复杂,但是在图中只显示三条线。如果改为通达信可以把MD改为其它函数试试比如WMA,以生命线分强弱,地命线以下建议不操作,如果要操作的话建议结合其它指标比如乖离,天命线以上为强势股,但是要注意风险,本指标对做强势股会有帮助。
源码
bc:=(IF(C>(H+L+C)/3,(H*0.618+L*0.382)*0.382,(H*0.382+L*0.618)*0.382)+(O*0.382+C*0.618)*0.618);
MA0c:=((EMA(c,6)+EMA(c,7))/2+MD(c,13/2))/2;
MA0h:=((EMA(h,6)+EMA(h,7))/2+MD(h,13/2))/2;
MA0l:=((EMA(l,6)+EMA(l,7))/2+MD(l,13/2))/2;
MA0o:=((EMA(O,6)+EMA(O,7))/2+MD(O,13/2))/2;
MA7:=((MA0c*0.618+MA0O*0.382)*0.618+(MA0H*0.5+MA0L*0.5)*0.382);
MAc:=((EMA(c,6*2)+EMA(c,7*2))/2+MD(c,13))/2;
MAh:=((EMA(h,6*2)+EMA(h,7*2))/2+MD(h,13))/2;
MAl:=((EMA(l,6*2)+EMA(l,7*2))/2+MD(l,13))/2;
MAo:=((EMA(O,6*2)+EMA(O,7*2))/2+MD(O,13))/2;
MA13:=((MAc*0.618+MAO*0.382)*0.618+(MAH*0.5+MAL*0.5)*0.382);
MA3c:=((EMA(c,(6*4))+EMA(c,(4*7)))/2+MD(c,26))/2;
MA3h:=((EMA(h,(6*4))+EMA(h,(4*7)))/2+MD(h,26))/2;
MA3l:=((EMA(l,(6*4))+EMA(l,(4*7)))/2+MD(l,26))/2;
MA3o:=((EMA(O,(6*4))+EMA(O,(4*7)))/2+MD(O,26))/2;
MA26:=(((MA3c*0.618+MA3O*0.382)*0.618+(MA3H*0.5+MA3L*0.5)*0.382));
FJc:=((EMA(c,6*8)+EMA(c,7*8))/2+MD(c,13*8/2))/2;
FJh:=((EMA(h,6*8)+EMA(h,7*8))/2+MD(h,13*8/2))/2;
FJl:=((EMA(l,6*8)+EMA(l,7*8))/2+MD(l,13*8/2))/2;
FJo:=((EMA(o,6*8)+EMA(o,7*8))/2+MD(o,13*8/2))/2;
MA52:=((FJc*0.618+FJO*0.382)*0.618+(FJH*0.5+FJL*0.5)*0.382);
lxc:=((EMA(c,16*6)+EMA(c,16*7))/2+MD(c,16*13/2))/2;
lxh:=((EMA(h,16*6)+EMA(h,16*7))/2+MD(h,16*13/2))/2;
lxl:=((EMA(l,16*6)+EMA(l,16*7))/2+MD(l,16*13/2))/2;
lxo:=((EMA(o,16*6)+EMA(o,16*7))/2+MD(o,16*13/2))/2;
lx:=((lxc*0.618+lxO*0.382)*0.618+(lxH*0.5+lxL*0.5)*0.382);
EM7:=((ema(bc,7)+ema(bc,8))/2+MD(bc,15/2))/2;
EM15:=((ema(bc,7*2)+ema(bc,8*2))/2+MD(bc,15))/2;
EM30:=((ema(bc,7*4)+ema(bc,8*4))/2+MD(bc,15*2))/2;
EM60:=((ema(bc,7*8)+ema(bc,8*8))/2+MD(bc,15*4))/2;
EM120:=((ema(bc,7*16)+ema(bc,8*16))/2+MD(bc,15*8))/2;
EM240:=((ema(bc,7*32)+ema(bc,8*32))/2+MD(bc,15*16))/2;
HL1:=((MD(hhv(bc,7),1)+MD(llv(bc,8),1))/2+EM7)/2;
HL2:=((MD(hhv(bc,7*2),1)+MD(llv(bc,8*2),1))/2+EM15)/2;
HL4:=((MD(hhv(bc,7*4),1)+MD(llv(bc,8*4),1))/2+EM30)/2;
HL8:=((MD(hhv(bc,7*8),1)+MD(llv(bc,8*8),1))/2+EM60)/2;
HL16:=((MD(hhv(bc,7*16),1)+MD(llv(bc,8*16),1))/2+EM120)/2;
HL32:=((MD(hhv(bc,7*32),1)+MD(llv(bc,8*32),1))/2+EM240)/2;
生:=(HL1+HL2+HL4+HL8+HL16+HL32)/6;
拉:=生+(STD(bc,15/2)+STD(bc,15)+STD(bc,15*2)+STD(bc,15*4)+STD(bc,15*8)+STD(bc,15*16))/6;
杀:=生-(STD(bc,15/2)+STD(bc,15)+STD(bc,15*2)+STD(bc,15*4)+STD(bc,15*8)+STD(bc,15*16))/6;
生命线:((MA7+MA13+MA26+MA52+LX)/5+((MD(HHV(bc,6),1)+MD(HHV(bc,12),1)+MD(HHV(bc,24),1)+MD(HHV(bc,48),1)+MD(HHV(bc,16*6),1))/5+(MD(LLV(bc,7),1)+MD(LLV(bc,14),1)
+MD(LLV(bc,28),1)+MD(LLV(bc,56),1)+MD(LLV(bc,16*7),1))/5)/2)/2,COLORWHITE;
升:=生命线+(STD(bc,13/2)+STD(bc,13)+STD(bc,26)+STD(bc,13*8/2)+STD(bc,16*13/2))/5;
跌:=生命线-(STD(bc,13/2)+STD(bc,13)+STD(bc,26)+STD(bc,13*8/2)+STD(bc,16*13/2))/5;
天命线:(拉+升)/2,COLOR6600FF;
地命线:(杀+跌)/2,COLOR00bb00;