通达信峰顶谷底线公式
{N:2 60 5}
DING:=MAX(O,C);{实顶}
DI:=MIN(O,C);{实底}
SDING:=CURRBARSCOUNT>=N AND DING=HHV(DING,N) AND
DING>REFX(HHV(DING,N-1),N-1);
DRAWLINE(SDING,DING,REF(SDING,1),REF(DING,1),1),COLORDB9370;
XDING:=CURRBARSCOUNT>=N
AND H=HHV(H,N) AND
H>REFX(HHV(H,N-1),N-1);
DRAWLINE(XDING,H,REF(XDING,1),REF(H,1),1),COLORDB9370,DOTLINE;
SDI:=CURRBARSCOUNT>=N
AND DI=LLV(DI,N) AND
DI<REFX(LLV(DI,N-1),N-1);
DRAWLINE(SDI,DI,REF(SDI,1),REF(DI,1),1),COLORE47833;
XDI:=CURRBARSCOUNT>=N
AND L=LLV(L,N) AND
L<REFX(LLV(L,N-1),N-1);
DRAWLINE(XDI,L,REF(XDI,1),REF(L,1),1),COLORE47833,DOTLINE;
X:=(3*C+L+O+H)/6;
多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)
+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)
+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+
REF(X,20))/210,COLORMAGENTA,LINETHICK2;
PMA:=MA(C,5),COLORWHITE,LINETHICK2;
DD:=多空线<REF(多空线,1);
IF(DD,多空线,DRAWNULL),COLOR00FFFF,LINETHICK2;
A:=(PMA>多空线);
IF(A,多空线,DRAWNULL),COLOR33FF33,POINTDOT,LINETHICK4;