T2:=CONST(BARSLAST((CURRBARSCOUNT (CC+T1)) AND (HIGH T1HIGH)));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST((CURRBARSCOUNT (CC+T2)) AND (HIGH T2HIGH)));
T3HIGH:=CONST(REF(HIGH,T3));
AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA:=EMA(AB,5);
A1{高}:=REFDATE(REF(HHV(H,96),5),DATE);
B1{低}:=REFDATE(REF(LLV(L,96),5),DATE);
DY{中}:=((A1)+(B1))/2;
箱顶:IF(AB 0 AND AB-BA =0,A1,A1),COLORGREEN,DOTLINE;
DRAWTEXT(ISLASTBAR,箱顶,'箱顶'),COLORYELLOW;
VARAA:=IF(CLOSE 150,91.3,0.913);
{突破:INTPART(CLOSE/VARAA )*VARAA,POINTDOT,LINETHICK4,COLORRED;
再突破:突破+VARAA,POINTDOT,LINETHICK4,COLOR00FF00 ;
回踩:(突破+再突破)/2,POINTDOT,COLORWHITE,LINETHICK4;};
公式模块:
N:=7;
T1:=CONST(LLVBARS(LOW,N));
T1HIGH:=CONST(REF(HIGH,T1));
CC:=CONST(CURRBARSCOUNT);
T2:=CONST(BARSLAST((CURRBARSCOUNT (CC+T1)) AND (HIGH T1HIGH)));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST((CURRBARSCOUNT (CC+T2)) AND (HIGH T2HIGH)));
T3HIGH:=CONST(REF(HIGH,T3));
AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA:=EMA(AB,5);
A1:=REFDATE(REF(HHV(H,96),5),DATE);
箱顶:=IF(AB 0 AND AB-BA =0,A1,A1);
C =箱顶 AND O