1229pta行情回放 自用主圖指標(biāo)supertren加維加斯通道加箱底箱...

N:=9;
M:=4;
TR1:=MAX(MAX((O-C),ABS(REF(CLOSE,1)-H)),ABS(REF(CLOSE,1)-L));
UP:=(H+L)/2+MA(TR1,N)*M;
DN:=(H+L)/2-MA(TR1,N)*M;
L1:=REF(UP,BARSLAST(UP<=REF(UP,1)));
L2:=LLV(UP,N*1.5);
LL:=IF(L2<>REF(L2,1) AND L1<REF(L1,1),L1,IF(L1=L2,L1,L2));
S1:=BARSLAST(CROSS(0.5,UP=LL))+1;
S2:=CROSS(COUNT((CROSS(C,LL) OR CROSS(C,REF(LL,2))) AND UP>LL,S1),0.5);
A6:=BARSLAST(S2);
B6:=BARSLAST(CROSS(HHV(DN,A6+1),C));
BY:=CROSS(B6,A6);
SL:=CROSS(A6,B6);
SUPERTREN:IF(B6>A6,HHV(DN,BARSLAST(BY)+1),LLV(UP,BARSLAST(SL)+1)),COLORWHITE;
M1:IFELSE(B6>A6,SUPERTREN,NULL),COLORRED;
M2:IFELSE(B6<A6,SUPERTREN,NULL),COLORGREEN;
DRAWTEXT(CROSS(B6,A6),L,'B');
DRAWTEXT(CROSS(A6,B6),H,'S');
EMA144:EMA(C,144);
EMA166:EMA(C,166);
IF(EMA144>EMA166,EMA144,DRAWNULL),COLORRED,LINETHICK2;
IF(EMA144<EMA166,EMA166,DRAWNULL),COLORGREEN,LINETHICK2;
DRAWICON(CROSS(EMA144,EMA166),H,'4');
DRAWICON(CROSS(EMA166,EMA144),L,'5');
N5:=50;
PRICE:=(OPEN+HIGH+LOW+CLOSE*2)/5;
UPPERBAND:REF(HHV(PRICE,N5),1),COLORBLUE;
LOWERBAND:REF(LLV(PRICE,N5),1);