zhouqi模型
B:=100/(SYSPARAM(4)-SYSPARAM(5));
Y:=(SYSPARAM(4)+SYSPARAM(5))*B/2-50;
FC:=CLOSE-REF(CLOSE,1);
STICKLINE(OPEN<CLOSE OR OPEN=CLOSE AND FC>0,LOW*B-Y,HIGH*B-Y,0.1,0),color4A3A46;
STICKLINE(OPEN<CLOSE OR OPEN=CLOSE AND FC>0,OPEN*B-Y,CLOSE*B-Y,6,1),color4A3A46;
STICKLINE(OPEN>CLOSE OR OPEN=CLOSE AND FC<0,LOW*B-Y,HIGH*B-Y,0.1,0),color4A3A46;
STICKLINE(OPEN>CLOSE OR OPEN=CLOSE AND FC<0,OPEN*B-Y,CLOSE*B-Y,6,0),color4A3A46;
KK:=BARPOS;
K:=SYSPARAM(1)=BARPOS;
VARIABLE:TEST=1;
FOR I=1 TO 60 DO BEGIN
TEST:=TEST AND HIGH>REFX(HIGH,I);
END;
COND:=TEST AND HIGH=HHV(HIGH,60);
HH:=IF(COND,KK,0);
VARIABLE:TEST=1;
FOR I=1 TO 60 DO BEGIN
TEST:=TEST AND LOW<REFX(LOW,I);
END;
COND1:=TEST AND LOW=LLV(LOW,60);
LL:=IF(COND1,KK,0);
HL:=(IF(HH>0,107,0))+(IF(LL>0,-1,0));
DRAWNUMBER(HL>0 OR HL=-1,HL,KK,0);
顶底数:=SUM(IF(HH>0,1,IF(LL>0,1,0)),0);
底数:=SUM(IF(LL>0,1,0),0);
顶数:=SUM(IF(HH>0,1,0),0);
VARIABLE:TEST=1;
FOR I=1 TO 3 DO BEGIN
TEST:=TEST AND HIGH>REFX(HIGH,I);
END;
COND:=TEST AND HIGH=HHV(HIGH,3);
HHH:=IF(COND,1,0);
VARIABLE:TEST=1;
FOR I=1 TO 3 DO BEGIN
TEST:=TEST AND LOW<REFX(LOW,I);
END;
COND1:=TEST AND LOW=LLV(LOW,3);
LLL:=IF(COND1,1,0);
W1:=HHV(IF(DATE=模型1 AND HHH,KK,0),0);
STICKLINE(DATE=模型1,LOW*B-Y,0,0.8,1),colorFF00;
月日:=DATE-1000000;
模1:=IF(W1*2-(IF(W1>18,18,0))=KK OR W1*2-(IF(W1>35,35,0))=KK OR W1*2-(IF(W1>45,45,0))=KK OR W1*2-(IF(W1>145,145,0))=KK OR W1*2-(IF(W1>104,104,0))=KK OR W1*2-(IF(W1>135,135,0))=KK OR W1*2-(IF(W1>200,200,0))=KK OR W1*2-(IF(W1>364,364,0))=KK OR W1*2-(IF(W1>473,473,0))=KK OR W1*2-(IF(W1>420,420,0))=KK OR W1*2-(IF(W1>439,439,0))=KK OR W1*2-(IF(W1>476,476,0))=KK OR W1*2-(IF(W1>443,443,0))=KK OR W1*2-(IF(W1>500,500,0))=KK OR W1*2-(IF(W1>576,576,0))=KK OR W1*2-(IF(W1>562,562,0))=KK OR W1*2-(IF(W1>504,504,0))=KK OR W1*2-(IF(W1>532,532,0))=KK OR W1*2-(IF(W1>529,529,0))=KK OR W1*2-(IF(W1>601,601,0))=KK OR W1*2-(IF(W1>664,664,0))=KK OR W1*2-(IF(W1>626,626,0))=KK OR W1*2-(IF(W1>659,659,0))=KK,100,0);
DRAWICON(DATE=模型1,HIGH*B-Y,5);
STICKLINE(模1>0,50,0,0.8,1),colorFF00;
DRAWTEXT(DATE=模型1 AND HHH,10,'模型一'),colorFF00;
DRAWNUMBER(模1>0,10,月日,0),colorFFFFFF;
WA:=HHV(IF(DATE=模型2 AND LLL,KK,0),0);
STICKLINE(DATE=模型2,100,HIGH*B-Y,0.8,1),colorFFFF;
模型一:IF(模1>0,KK,0),LINETHICK0,colorFF00;
模2:=IF(WA*2-(IF(WA>18,18,0))=KK OR WA*2-(IF(WA>35,35,0))=KK OR WA*2-(IF(WA>45,45,0))=KK OR WA*2-(IF(WA>145,145,0))=KK OR WA*2-(IF(WA>104,104,0))=KK OR WA*2-(IF(WA>135,135,0))=KK OR WA*2-(IF(WA>200,200,0))=KK OR WA*2-(IF(WA>364,364,0))=KK OR WA*2-(IF(WA>473,473,0))=KK OR WA*2-(IF(WA>420,420,0))=KK OR WA*2-(IF(WA>439,439,0))=KK OR WA*2-(IF(WA>476,476,0))=KK OR WA*2-(IF(WA>443,443,0))=KK OR WA*2-(IF(WA>500,500,0))=KK OR WA*2-(IF(WA>576,576,0))=KK OR WA*2-(IF(WA>562,562,0))=KK OR WA*2-(IF(WA>504,504,0))=KK OR WA*2-(IF(WA>532,532,0))=KK OR WA*2-(IF(WA>529,529,0))=KK OR WA*2-(IF(WA>601,601,0))=KK OR WA*2-(IF(WA>664,664,0))=KK OR WA*2-(IF(WA>626,626,0))=KK OR WA*2-(IF(WA>659,659,0))=KK,100,0);
DRAWICON(DATE=模型2,HIGH*B-Y,4);
STICKLINE(模2>0,50,100,0.8,1),colorFFFF;
DRAWNUMBER(模2>0,80,月日,0),colorFFFFFF;
前顶:=REF(KK,BARSLAST(HH)+1)+1;
前底:=REF(KK,BARSLAST(LL)+1)+1;
DRAWTEXT(DATE=模型2 AND LLL,90,'模型二'),colorFF00;
模型二:IF(模2>0,KK,0),LINETHICK0,colorFFFF;
W2:=HHV(IF(DATE=模型3,KK,0),0);
STICKLINE(DATE=模型3,LOW*B-Y,0,0.8,1),colorFF00FF;
前D:=HHV(IF(DATE=模型3 AND HHH,REF(前顶,1),0),0);
模3:=IF(W2+前D-(IF(前D>18,18,0))=KK OR W2+前D-(IF(前D>35,35,0))=KK OR W2+前D-(IF(前D>45,45,0))=KK OR W2+前D-(IF(前D>145,145,0))=KK OR W2+前D-(IF(前D>104,104,0))=KK OR W2+前D-(IF(前D>135,135,0))=KK OR W2+前D-(IF(前D>200,200,0))=KK OR W2+前D-(IF(前D>364,364,0))=KK OR W2+前D-(IF(前D>473,473,0))=KK OR W2+前D-(IF(前D>420,420,0))=KK OR W2+前D-(IF(前D>439,439,0))=KK OR W2+前D-(IF(前D>476,476,0))=KK OR W2+前D-(IF(前D>443,443,0))=KK OR W2+前D-(IF(前D>500,500,0))=KK OR W2+前D-(IF(前D>576,576,0))=KK OR W2+前D-(IF(前D>562,562,0))=KK OR W2+前D-(IF(前D>504,504,0))=KK OR W2+前D-(IF(前D>532,532,0))=KK OR W2+前D-(IF(前D>529,529,0))=KK OR W2+前D-(IF(前D>601,601,0))=KK OR W2+前D-(IF(前D>664,664,0))=KK OR W2+前D-(IF(前D>626,626,0))=KK OR W2+前D-(IF(前D>659,659,0))=KK,100,0);
DRAWICON(DATE=模型3,HIGH*B-Y,5);
STICKLINE(模3>0,50,0,0.8,1),colorFF00FF;
DRAWTEXT(DATE=模型3 AND HHH,20,'模型三'),colorFF00;
DRAWNUMBER(模3>0,20,月日,0),colorFFFFFF;
模型三:IF(模3>0,KK,0),LINETHICK0,colorFF00FF;
W3:=HHV(IF(DATE=模型4,KK,0),0);
STICKLINE(DATE=模型4,100,HIGH*B-Y,0.8,1),colorFF;
前I:=HHV(IF(DATE=模型4 AND LLL,REF(前底,1),0),0);
模4:=IF(W3+前I-(IF(前I>18,18,0))=KK OR W3+前I-(IF(前I>35,35,0))=KK OR W3+前I-(IF(前I>45,45,0))=KK OR W3+前I-(IF(前I>145,145,0))=KK OR W3+前I-(IF(前I>104,104,0))=KK OR W3+前I-(IF(前I>135,135,0))=KK OR W3+前I-(IF(前I>200,200,0))=KK OR W3+前I-(IF(前I>364,364,0))=KK OR W3+前I-(IF(前I>473,473,0))=KK OR W3+前I-(IF(前I>420,420,0))=KK OR W3+前I-(IF(前I>439,439,0))=KK OR W3+前I-(IF(前I>476,476,0))=KK OR W3+前I-(IF(前I>443,443,0))=KK OR W3+前I-(IF(前I>500,500,0))=KK OR W3+前I-(IF(前I>576,576,0))=KK OR W3+前I-(IF(前I>562,562,0))=KK OR W3+前I-(IF(前I>504,504,0))=KK OR W3+前I-(IF(前I>532,532,0))=KK OR W3+前I-(IF(前I>529,529,0))=KK OR W3+前I-(IF(前I>601,601,0))=KK OR W3+前I-(IF(前I>664,664,0))=KK OR W3+前I-(IF(前I>626,626,0))=KK OR W3+前I-(IF(前I>659,659,0))=KK,100,0);
DRAWICON(DATE=模型4,HIGH*B-Y,4);
STICKLINE(模4>0,50,100,0.8,1),colorFF;
DRAWTEXT(DATE=模型4 AND LLL,80,'模型四'),colorFF00;
DRAWNUMBER(模4>0,60,月日,0),colorFFFFFF;
模型四:IF(模4>0,KK,0),LINETHICK0,colorFF;
QD:=SYSPARAM(2)=BARPOS;
DRAWTEXT(QD,107,'███████'),ALIGN1,colorFFFFFF;
DRAWTEXT(QD,80,'██████'),ALIGN1,colorFFFFFF;
DRAWTEXT(QD,29,'██████'),ALIGN1,colorFFFFFF;
DRAWTEXT(QD,-1,'███████'),ALIGN1,colorFFFFFF;
DRAWTEXT(QD,107,'顶部拐点序列数'),ALIGN1,color4441FF;
DRAWTEXT(QD,80,'模型2~4时间:'),ALIGN1,color4441FF;
DRAWTEXT(QD,29,'模型1~3时间'),ALIGN1,color4441FF;
DRAWTEXT(QD,-1,'底部拐点序列数'),ALIGN1,color4441FF;
███:0,SHIFT3,color4441FF;
-8,SHIFT3,color4441FF;
50,SHIFT3,color4441FF;
108,SHIFT3,color4441FF;
100,SHIFT3,color4441FF;
|