对于公式不必太过较劲.没有百分之百. 没有完全正确. 也没有完美无缺的公式. 就连K线图形也是【人】编辑出来的.  因为要保密哪位编辑的K线图形【操盘手的老爹】.也不会知道未来K线会是什么样.何况你我小小的散户.
现在还是书归正传 看看源码吧——————–
{K线变色}
STICKLINE(CLOSE>OPEN,HIGH,LOW,0.5,0 ),COLOR0000FF;    
 STICKLINE(OPEN>=CLOSE,HIGH,LOW,0.5 ,0 ),COLOR00FF00;
   
 STICKLINE(open>=close ,close ,open,0,0 ),COLOR00FF00,LAYER0;
 STICKLINE(open>=close ,close ,open,8,0 ),COLOR008800,LAYER0;
 STICKLINE(open>=close ,close ,open,7,0 ),COLOR009900,LAYER0;
 STICKLINE(open>=close ,close ,open,6,0 ),COLOR00AA00,LAYER0;
 STICKLINE(open>=close ,close ,open,5,0 ),COLOR00BB00,LAYER0;
 STICKLINE(open>=close ,close ,open,4,0 ),COLOR00CC00,LAYER0;
 STICKLINE(open>=close ,close ,open,3,0 ),COLOR00DD00,LAYER0;
 STICKLINE(open>=close ,close ,open,2,0 ),COLOR00EE00,LAYER0;
 STICKLINE(open>=close ,close ,open,1,0 ),COLOR00FF00,LAYER0;

STICKLINE(close>open,close,open,0,0) ,COLORFFBBFF,LAYER0;
 STICKLINE(close>open,close,open,8,0) ,COLORFF00FF,LAYER0;
 STICKLINE(close>open,close,open,7,0) ,COLORFF22FF,LAYER0;
 STICKLINE(close>open,close,open,6,0) ,COLORFF44FF,LAYER0;
 STICKLINE(close>open,close,open,5,0) ,COLORFF66FF,LAYER0;
 STICKLINE(close>open,close,open,4,0) ,COLORFF88FF,LAYER0;
 STICKLINE(close>open,close,open,3,0) ,COLORFF99FF,LAYER0;
 STICKLINE(close>open,close,open,2,0) ,COLORFFAAFF,LAYER0;
 STICKLINE(close>open,close,open,1,0) ,COLORFFBBFF,LAYER0;

现价: if (DYNAINFO(4)=0,C,DYNAINFO(7)),colorwhite,POINTDOT;
箱顶:WMA(REF(HHV(C,30),1),3),COLOR0099FF,LINETHICK2;
箱底:WMA(REF(LLV(C,30),1),3),COLORFF9900,LINETHICK2;
 (箱顶+箱底)/2,COLOR00FFff,LINETHICK1;;
 VARJ:FORCAST(C+C*(CLOSE-FORCAST(CLOSE,13))/FORCAST(CLOSE,13),8),colorwhite,DOTLINE,LAYER0;;
 x9:FORCAST(C,9),Colorwhite,LINETHICK2;
 llx:=llv(FORCAST(C,9),2);
 PARTLINE(x9,x9=llx,rgb(0,255,0),x9<>llx,rgb(255,0,0)),linethick2,LAYER0;
 FILLRGN(VARJ ,x9 ,VARJ>x9,RGB(80,0,80)),LINETHICK1,LAYER7;

{ZIG ————-未来函数————–}
ZF:=10;
 Z10:=ZIG(4,ZF);
 Low1:=TROUGH(4,ZF ,1);
 High1:=PEAK(4,ZF,1);
 X:=BARSLAST(DISPSTATUS=1)+1; 
持有:LAST(Z10>=REF(Z10,1)),PRECIS0 ,LINETHICK0;
空仓:LAST(Z10<REF(Z10,1)),PRECIS0,LINETHICK0;
 JD:=HHvall(HHv(H,X))*1.05;
 DRAWTEXT(barstatus=2 AND 持有>0,JD,’★ZIG上涨能飘逸范围【L:’+Low1+’→H:’+NUMTOSTRN(Low1*(1+ZF/100),2)+’】’),ALIGN2,Color0099ff,linethick3,LAYER0;
 DRAWTEXT(barstatus=2 AND 空仓>0,JD,’★ZIG下跌能飘逸范围【H:’+High1+’→L:’+NUMTOSTRN(High1*(1-ZF/100),2)+’】’),ALIGN2,Color00FF00,linethick3,LAYER0;
 STICKLINE(BARSTATUS=2 AND 持有>0,Low1,Low1*(1+ZF/100),14,1),COLOR0099dd,LINETHICK1,LAYER4;
 STICKLINE(BARSTATUS=2 AND 持有>0,Low1*(1+ZF/100),Low1*(1+ZF/100),150,1),COLOR0000ff,LINETHICK2,LAYER2;
 STICKLINE(BARSTATUS=2 AND 空仓>0,High1,High1*(1-ZF/100),14,1),COLORff9900,LINETHICK1,LAYER4;
 STICKLINE(BARSTATUS=2 AND 空仓>0,High1*(1-ZF/100),High1*(1-ZF/100),150,1),COLOR00ff00,LINETHICk2,LAYER2;
 {PARTLINE(Z10,Z10>=REF(Z10,1),rgb(255,0,0),Z10<REF(Z10,1),rgb(0,255,0)),DOTLINE,LAYER2;}
 DRAWGBK(Z10>REF(Z10,1) ,STRIP(RGB(0,0,150),RGB(0,80,255),0));  {—-ZIG波段—–};
 {主图仪表}
M5:=MA(C,5);
 M10:=MA(C,10);
 M20:=MA(C,20);
 M30:=MA(C,30);;
 M60:=MA(C,60);
 M120:=MA(C,120);
 LC:=REF(C,1);
主升浪:=DISPSTATUS=2 AND M5>M20 AND M20>M60 AND M60>M120 AND M20>=REF(M20,1) AND M60>=REF(M60,1) AND M120>=REF(M120,1);
主浪回调:=DISPSTATUS=2 AND C<LC AND (C<M5 OR M5<REF(M5,1)) AND M5>M20 AND M20>M60 AND M20>=REF(M20,1) AND M60>=REF(M60,1);
主浪深调:=DISPSTATUS=2 AND C<LC AND C<M5 AND M5<REF(M5,1) AND M5<M60 AND M5<M20 AND M10>M20 AND M20>M60 AND M20>=REF(M20,1) AND M60>=REF(M60,1);
初升浪:=DISPSTATUS=2 AND C>LC AND C>(M5 OR M10) AND M5>(M20 OR M10) AND M5>=REF(M5,1) AND C>M20 AND (M5 OR M10)>M20 AND M20>=REF(M20,1) AND M60<(C OR M5 OR M10);
底部反弹:=DISPSTATUS=2 AND C>LC AND M120>M60 AND M60>M20 AND M5>M20;
有牛:=DISPSTATUS=2 AND C>LC AND M20>=REF(M20,1) AND C>=M60 AND M60<(C OR M5 OR M10) AND C>=M120;
放弃:=DISPSTATUS=2 AND C<LC AND C<M10 AND C<M20 AND M20<M60 AND M20<REF(M20,1);
满仓:=IF(DISPSTATUS=2 AND (C>M5 OR M5>=REF(M5,1)) AND C>M10 AND (M5>=M10 OR (M5>=M20 AND M5>=REF(M5,1)))
           AND M5>M20 AND M10>M20 AND M20>M60 AND M30>M120 AND M10>=REF(M10,1) AND M20>=REF(M20,1)
           AND M60>=REF(M60,1) AND M120>=REF(M120,1),1,0);
大半仓:=DISPSTATUS=2 AND (C>M10 OR (C>M5 AND M10>=REF(M10,1))) AND M5>=M20 AND (M10>=M20 OR M10>=REF(M10,1)) AND M20>=M60
          AND (M10>=REF(M10,1) OR (C>M5 AND M5>=REF(M5,1))) AND M20>=REF(M20,1) AND M60>=REF(M60,1);
上升回调:=DISPSTATUS=2 AND C<M5 AND M5<M10 AND M5>M20 AND M10>M20 AND M20>M60 AND M5<=REF(M5,1) AND
           M10<REF(M10,1) AND M20>=REF(M20,1) AND M60>=REF(M60,1);
减仓:=DISPSTATUS=2 AND C<LC AND M5<REF(M5,1) AND M10<REF(M10,1) AND M5<M20 AND M10<M20 AND M20>=REF(M20,1);
半仓:=DISPSTATUS=2 AND C>M5 AND M5>M10 AND M10>M20 AND M20>=M30 AND M5>=REF(M5,1) AND M10>=REF(M10,1)
          AND M20>=REF(M20,1) AND M30>=REF(M30,1) AND M30>=M60 AND M60<=REF(M60,1);
反弹:=DISPSTATUS=2 AND C>M5 AND C>M10 AND M5>M20 AND M60>M20 AND M20>=REF(M20,1) AND M60<REF(M60,1);
初升浪:=DISPSTATUS=2 AND C>LC AND C>(M5 OR M10) AND M5>(M20 OR M10) AND M5>=REF(M5,1) AND C>M20 AND (M5 OR M10)>M20 AND M20>=REF(M20,1) AND M60<(C OR M5 OR M10);
探底阶段:=DISPSTATUS=2 AND C<M5 AND M5<M10 AND M10<M20 AND M20<M60 AND M5<REF(M5,1) AND M10<REF(M10,1)
          AND M20<REF(M20,1) AND M60<REF(M60,1);
小半仓:=DISPSTATUS=2 AND C>=LC AND C>=M5 AND M5>=M10 AND M10>=M20 AND M5>=REF(M5,1) AND M10>=REF(M10,1) AND
          M20>=REF(M20,1) AND M20<M60 AND M60<=REF(M60,1);
关注:=DISPSTATUS=2 AND C>LC AND C>M5 AND C>M20 AND M5>M10 AND M5>REF(M5,1) AND M10>REF(M10,1) AND M20<=REF(M20,1) AND
          M20<=M60;
空仓:=DISPSTATUS=2 AND (M5<M20 OR M10<M20) AND M20<M60 AND M5<=REF(M5,1) AND M10<=REF(M10,1) AND M20<REF(M20,1);
上穿3线:=IF(DISPSTATUS=2 AND C>MAX(M5,MAX(M10,MIN(M20,M30))) AND LC<=(MIN(REF(M5,1),MIN(REF(M10,1),MAX(REF(M20,1),REF(M30,1))))),1,0);
下破3线:=IF(DISPSTATUS=2 AND C<MIN(M5,MIN(M10,MAX(M20,M30))) AND LC>=(MAX(REF(M5,1),MAX(REF(M10,1),MIN(REF(M20,1),REF(M30,1))))),1,0);
观望:=DISPSTATUS=2 AND 满仓=0 AND 大半仓=0 AND 上升回调=0 AND 减仓=0 AND 半仓=0 AND 反弹=0 AND 探底阶段=0
           AND 小半仓=0 AND 关注=0 AND 空仓=0 AND 上穿3线=0 AND 下破3线=0;

IF  满仓 AND 上穿3线=0  THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【满仓】’),color0044FF,LINETHICK7; END;
 IF  主升浪  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【主升浪】’),color0099FF,LINETHICK7; END;
 IF  主浪回调  THEN  BEGIN
 DRAWTEXTABS(950,50, ‘【主浪回调】’),color00FF00,LINETHICK7; END;
 IF  主浪深调   THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【主浪深调】’),color00FF00,LINETHICK7; END;
 IF  底部反弹  THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【底部反弹】’),color0099FF,LINETHICK7; END;
 IF  有牛  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【有牛】’),color0000FF,LINETHICK7; END;
 IF  放弃   THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【放弃】’),color00FF00,LINETHICK7; END;
 IF  上升回调  THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【上升回调】’),color99FF99,LINETHICK7; END;
 IF  大半仓 AND (满仓=0 AND BARSCOUNT(C)>60)  THEN  BEGIN
 DRAWTEXTABS(980,15, ‘【大半仓】’),colorff00FF,LINETHICK7; END;
 IF  减仓   THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【减仓】’),color00FF00,LINETHICK7; END;
 IF  半仓  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【半仓】’),color0099FF,LINETHICK7; END;
 IF  反弹  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【反弹】’),color0044FF,LINETHICK7; END;
 IF  初升浪   THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【初升浪】’),color0099FF,LINETHICK7; END;
 IF  探底阶段  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【探底阶段】’),color0099FF,LINETHICK7; END;
 IF  关注  THEN  BEGIN
 DRAWTEXTABS(800,15, ‘【关注】’),color0044FF,LINETHICK7; END;
 IF  初升浪   THEN  BEGIN
 DRAWTEXTABS(950,15, ‘【初升浪】’),color0099FF,LINETHICK7; END;
 IF  上穿3线  THEN  BEGIN
 DRAWTEXTABS(800,50, ‘【上穿3线】’),color0099FF,LINETHICK7; END;
 IF  下破3线  THEN  BEGIN
 DRAWTEXTABS(800,50, ‘【下破3线】’),color00FF00,LINETHICK7; END;
 IF  观望  THEN  BEGIN
 DRAWTEXTABS(800,45, ‘【观望】’),color00FFff,LINETHICK7; END;
 VARF1:=COUNT(CROSS(WMA(C,1.8),WMA(WMA(C,5),3)),3)=1;
 VARF2:=COUNT(CROSS(WMA(C,5),WMA(WMA(C,5),3)),3)=1;
 ZAI:=FILTER(VARF1 AND VARF2,5);
 DRAWTEXT(ZAI,L*0.99,’↖拉升’),COLOR00FFFF,linethick1;
 AAX:=(C-ma(C,8))/ma(C,8)*100;
 VARM:=MIN(COUNT(C,0),8);
 AAX1:=EMA(AAX,VARM) *VARM;
 AAX2:=MA(AAX1,3);
 AAX3:=MA(AAX1,5);
卖:aax3>10  AND aax1<REF(aax1,1) and cross(aax2,aax1),linethick0;
减仓:filter(卖,5) ,PRECIS0,linethick0;
 DRAWTEXT(减仓,H*1.03,’←减仓’),COLOR00FF00,linethick1,ALIGN0;


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。