编写要求:
VAR2:=CLOSE*VOL;VAR3:=EMA((EMA(VAR2,3)/EMA(VOL,3)+EMA(VAR2,6)/EMA(VOL,6)+EMA(VAR2,12)/EMA(VOL,12)+EMA(VAR2,24)/EMA(VOL,24))/4,13);VAR4:=EMA(CLOSE,9);SUP:1.06*VAR3;SDN:VAR3*0.94;LUP:EMA(VAR4*1.14,5);LDN:EMA(VAR4*0.86,5);要求当前股价上穿绿,黄,白,紫线,4种情况
解答:
{上穿绿线}
VAR4:=EMA(CLOSE,9);LDN:cross(c,EMA(VAR4*0.86,5)); {上穿紫线}VAR4:=EMA(CLOSE,9);LUP:cross(c,EMA(VAR4*1.14,5)); {上穿黄线}VAR2:=CLOSE*VOL;VAR3:=EMA((EMA(VAR2,3)/EMA(VOL,3)+EMA(VAR2,6)/EMA(VOL,6)+EMA(VAR2,12)/EMA(VOL,12)+EMA(VAR2,24)/EMA(VOL,24))/4,13);VAR4:=EMA(CLOSE,9);SDN:cross(c,VAR3*0.94); {上穿白线}VAR2:=CLOSE*VOL;VAR3:=EMA((EMA(VAR2,3)/EMA(VOL,3)+EMA(VAR2,6)/EMA(VOL,6)+EMA(VAR2,12)/EMA(VOL,12)+EMA(VAR2,24)/EMA(VOL,24))/4,13);VAR4:=EMA(CLOSE,9);cross(c,1.06*VAR3);