gspt1:=CLOSE=ZTPRICE(REF(CLOSE,1),0.1);
gspt2:=HIGH=ZTPRICE(REF(CLOSE,1),0.1) AND CLOSE<HIGH;
gspt3:=CLOSE=ZTPRICE(REF(CLOSE,1),0.2);
gspt4:=HIGH=ZTPRICE(REF(CLOSE,1),0.2) AND CLOSE<HIGH;
gspt5:=BARSLAST(CLOSE=LLV(CLOSE,60));
gspt6:=BETWEEN(gspt5,1,60) AND CLOSE/REF(CLOSE,1)>1.043;
gspt7:=gspt6 AND COUNT(gspt6,gspt5)=1;
gspt8:=BARSLAST(CLOSE=LLV(CLOSE,BARSLAST(gspt7)));
gspt9:=gspt8=1 AND CLOSE>REF(CLOSE,gspt8) AND HIGH>LOW;
gspt10:=STRCAT(HYBLOCK,' ');
gspt11:=STRCAT(gspt10,DYBLOCK);
gspt12:=STRCAT(gspt11,' ');
gspt13:=BARSLAST(COUNT(gspt9,BARSLAST(gspt7))=1 AND gspt9);
gspt14:=BARSLAST(COUNT(gspt9,BARSLAST(gspt7))=2 AND gspt9);
gspt15:=BARSLAST(COUNT(gspt9,BARSLAST(gspt7))=3 AND gspt9);
gspt16:=COUNT(gspt9,BARSLAST(gspt7))>3;
gspt17:=MAX(REF(CLOSE,gspt13),REF(CLOSE,gspt14));
gspt18:=MAX(gspt17,REF(CLOSE,gspt15));
gspt19:=IF(COUNT(gspt9,BARSLAST(gspt7))=1,REF(CLOSE,gspt13),0);
gspt20:=IF(COUNT(gspt9,BARSLAST(gspt7))=2,gspt17,0);
gspt21:=IF(COUNT(gspt9,BARSLAST(gspt7))=3,gspt18,0);
STICKLINE(gspt1,CLOSE,OPEN,2,0),COLORYELLOW;
STICKLINE(gspt2,CLOSE,OPEN,2,0),COLORMAGENTA;
STICKLINE(gspt3,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(gspt4,CLOSE,OPEN,2,0),COLORWHITE;
STICKLINE(gspt7,HIGH*1.1,LOW*0.9,0.3,1);
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(gspt12,GNBLOCK)),COLORRED;
地平线:CONST(gspt19+gspt20+gspt21),COLORMAGENTA;
gspt22:=CLOSE>=地平线 AND CLOSE/REF(CLOSE,1)>1.043;
gspt23:=COUNT(gspt22,BARSLAST(gspt7))=1 AND gspt22;
{,公式源码 }
VAR28:=CONST(REF(CLOSE,BARSLAST(gspt23)));
VAR29:=IF(gspt16 OR BARSLAST(gspt23)>BARSLAST(gspt7),0,VAR28);
DRAWTEXT(gspt23,1.03*HIGH,'破茧成蝶'),COLORYELLOW;
DRAWTEXT(BARSLASTCOUNT(gspt16)=1,0.97*LOW,'作茧自缚'),COLORWHITE;
DRAWICON(gspt23,0.99*LOW,29);
DRAWICON(BARSLASTCOUNT(gspt16)=1,LOW,9);
起飞线:CONST(VAR29),COLORGREEN;