VAR1:=LLV(LOW,6);{COW/BEAR+M20}
VAR2:=HHV(HIGH,6);
COW:=EMA((CLOSE-VAR1)/(VAR2-VAR1)*100,5);
BEAR:=EMA(0.667*REF(COW,1)+0.333*COW,2);
KK:=IF(COW>BEAR,1,1.025);
KEY:=CLOSE*BEAR/COW*KK;
M20:=IF((CLOSE>MA(CLOSE,20)),1,0);
BUYIN:TRADETO(0,KEY*M20);
SELLOUT:TRADETO(1,KEY); |