(来源:文华财经)
1、
M1:=1;
K1:=0.5;
K2:=0.5;
N:=BARSLAST(DATE<>REF(DATE,1))+1;
OO:=VALUEWHEN(DATE<>REF(DATE,1),O);
HH1:=REF(HHV(H,N*M),N);
LL1:=REF(LLV(L,N*M),N);
HC1:=REF(HHV(C,N*M),N);
LC1:=REF(LLV(C,N*M),N);
HH2:=REF(HHV(H,N*M1),N);
LL2:=REF(LLV(L,N*M1),N);
HC2:=REF(HHV(C,N*M1),N);
LC2:=REF(LLV(C,N*M1),N);
SELLR:IFELSE((HH1-LC1)>=(HC1-LL1),HH1-LC1,HC1-LL1);
BUYR:IFELSE((HH2-LC2)>=(HC2-LL2),HH2-LC2,HC2-LL2);
BT:=K1*BUYR;
ST:=K2*SELLR;
BUYP:OO+BT,COLORRED;
SELLP:OO-ST,COLORGREEN;
DRAWHORIZONTALLINE(TIME=2115,REF(HHV(H,DAYBARPOS),1),COLORRED),DOT;
2、
MA2:EMA2(C,10),NODRAW;
MA3:EMA2(C,20),NODRAW;
MA20:MA(C,20),COLORYELLOW,LINETHICK2,NODRAW;
A:=REF(HHV(C,20),1),COLORWHITE,NODRAW;
AA:=CROSS(C,A);
AAA:=VALUEWHEN(AA ,L);
DRAWSL(1,AAA,0,1,0,COLORRED),LINETHICK2;
B:=REF(LLV(MIN(C,O),15),1),COLORWHITE,NODRAW;
BB:FILTER(CROSSDOWN(C,B),10),COLORRED;
BBB:=VALUEWHEN(BB,H);
DRAWSL(1,BBB,0,1,0,COLORGREEN),LINETHICK2;