飞狐精品指标-箱体顶底
-
相关简介:C/C++ Code 复制内容到剪贴板 {06-箱体顶底} DRAWGBK(1,COLORRGB(100,100,100),COLORRGB(50,50,50),0); CC:=CLOSE; OO:=OPEN; HH:=HIGH; LL:=LOW; TOP:=HIGH; BOT:=LOW; XX[1]:=1; KK:=1; FORI=1TODATACOUNTDOBEGIN I
-
文章来源:择股网作者:股海网发布时间:2009-06-13浏览次数:
C/C++ Code复制内容到剪贴板
- {06-箱体顶底}
- DRAWGBK(1,COLORRGB(100,100,100),COLORRGB(50,50,50),0);
- CC:=CLOSE;
- OO:=OPEN;
- HH:=HIGH;
- LL:=LOW;
- TOP:=HIGH;
- BOT:=LOW;
- XX[1]:=1;
- KK:=1;
- FOR I=1 TO DATACOUNT DO BEGIN
- IF XX[I]=1 THEN BEGIN
- TOP[I]:=HH[I];
- END;
- IF XX[I-1]=1 THEN BEGIN
- IF HH[I]>TOP[I-1] THEN BEGIN
- TOP[I]:=HH[I];
- XX[I]:=1;
- END;ELSE BEGIN
- TOP[I]:=TOP[I-1];
- XX[I]:=2;
- END;
- END;
- IF XX[I-1]=2 THEN BEGIN
- IF HH[I]>TOP[I-1] THEN BEGIN
- TOP[I]:=HH[I];
- XX[I]:=1;
- END;ELSE BEGIN
- TOP[I]:=TOP[I-1];
- BOT[I]:=LL[I];
- XX[I]:=3;
- END;
- END;
- IF XX[I-1]=3 THEN BEGIN
- TOP[I]:=TOP[I-1];
- IF LL[I]<BOT[I-1] THEN BEGIN
- BOT[I]:=LL[I];
- XX[I]:=3;
- END;ELSE BEGIN
- BOT[I]:=BOT[I-1];
- XX[I]:=4;
- END;
- END;
- IF XX[I-1]=4 THEN BEGIN
- TOP[I]:=TOP[I-1];
- IF LL[I]<BOT[I-1] THEN BEGIN
- BOT[I]:=LL[I];
- XX[I]:=3;
- END;ELSE BEGIN
- BOT[I]:=BOT[I-1];
- XX[I]:=5;
- END;
- END;
- IF XX[I-1]=5 THEN BEGIN
- IF LL[I]<BOT[I-1] OR HH[I]>TOP[I-1] THEN BEGIN
- TOP[I]:=HH[I];
- BOT[I]:=HH[I];
- XX[I]:=1;
- END;ELSE BEGIN
- BOT[I]:=BOT[I-1];
- TOP[I]:=TOP[I-1];
- XX[I]:=5;
- END;
- END;
- END;
- FOR J=1 TO DATACOUNT DO BEGIN
- IF XX[J]=5 AND XX[J-1]=4 THEN BEGIN
- FOR K=J-1 DOWNTO J-KK DO BEGIN
- TOP[K]:=TOP[J];
- BOT[K]:=BOT[J];
- END;
- END;
- IF XX[J-1]=5 AND XX[J]=1 THEN
- KK:=0;
- KK:=KK+1;
- END;
- 中位线:=(TOP+BOT)/2;
- 买点:=FILTER(TROUGHBARS(3,15,1)<4=1,3);
- 卖点:=FILTER(PEAKBARS(3,15,1)<4=1,3);
- F:=100*(CLOSE-REF(CLOSE,1))/REF(CLOSE,1);
- P1:=IF(CLOSE<REF(OPEN,1) AND F<0,1,0);
- P3:=IF(CLOSE>REF(OPEN,1) AND F>0,1,0);
- P2:=IF(CLOSE<REF(OPEN,2) AND F<0,1,0);
- P4:=IF(CLOSE>REF(OPEN,2) AND F>0,1,0);
- 买D5:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1;
- 卖D6:=P3=0 AND REF(P3,1)=1 AND P4=0 AND REF(P4,1)=1;
- FZ:=PEAK(3,5,1);
- FW:=PEAKBARS(3,5,1);
- GZ:=TROUGH(3,5,1);
- GW:=TROUGHBARS(3,5,1);
- AS:=ZIG(3,3);
- 涨AL:=CROSS(AS,REF(AS,1));
- 跌AG:=CROSS(REF(AS,1),AS);
- SS1:=IF(FW>GW,FW,0);
- SS2:=IF(FW<GW,GW,0);
- SS3:=BARSLAST(SS1);
- SS4:=BARSLAST(SS2);
- PARTLINE(TOP=REF(TOP,1),TOP),color8293;
- PARTLINE(BOT=REF(BOT,1),BOT),color8293;
- STICKLINE((TOP<>REF(TOP,1) OR BOT<>REF(BOT,1)) AND XX=1 AND REF(XX,1)=5,TOP,BOT,1,0),color8293;
- STICKLINE((TOP<>REFX(TOP,1) OR BOT<>REFX(BOT,1)) AND XX=5 AND REFX(XX,1)=1,TOP,BOT,1,0),color8293;
- STICKLINE(CC>OO,CC,OO,8,1),color5454FF;
- STICKLINE(CC>OO,LL,OO,0.9,1),color5454FF;
- STICKLINE(CC>OO,HH,CC,0.9,1),color5454FF;
- STICKLINE(CC<OO,CC,OO,8,0.5),colorFFA800;
- STICKLINE(CC<OO,HH,LL,0.9,0.5),colorFFA800;
- STICKLINE(买点,LOW,(OPEN+CLOSE)/2,0,0),colorFFFFFF;
- STICKLINE(买点,CLOSE,(OPEN+CLOSE)/2,5,0),colorFFFFFF;
- STICKLINE(卖点,HIGH,(OPEN+CLOSE)/2,0,0),colorFFFF;
- STICKLINE(卖点,CLOSE,(OPEN+CLOSE)/2,5,0),colorFFFF;
- STICKLINE(买D5 AND 涨AL,LOW,(OPEN+CLOSE)/2,0,0),colorFFFFFF;
- STICKLINE(买D5 AND 涨AL,OPEN,(OPEN+CLOSE)/2,5,0),colorFFFFFF;
- STICKLINE(卖D6 AND 跌AG,LOW,(OPEN+CLOSE)/2,0,0),color3EA63E;
- STICKLINE(卖D6 AND 跌AG,OPEN,(OPEN+CLOSE)/2,5,0),color3EA63E;
- DRAWLINE(FW=0,FZ,GW=0 OR ISLASTBAR,REF(FZ,FW),0),color2A800;
- DRAWLINE(GW=0,GZ,FW=0 OR ISLASTBAR,REF(GZ,GW),0),colorFF00FF;
- DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,'■上涨第'+NUMTOSTR(SS4[SYSPARAM(1)],0)+'天'),ALIGN4,colorFF00FF;
- DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,' \n■下跌第'+NUMTOSTR(SS3[SYSPARAM(1)],0)+'天'),ALIGN4,colorFFFF00;
- PARTLINE(TOP=REF(TOP,1),中位线),LINEDOT,color8293;
上一篇:飞狐精品指标-阴线短操
下一篇:飞狐精品指标-快速短线