數組用序列,就會最后一根值全部往前賦值成一個值。
下列公式用逐k線模式
DIFF :=EMA(C,12) - EMA(C,26);
DEA :=EMA(DIFF,9);
MACD :=2*(DIFF-DEA), COLORSTICK;
MJ:=C;
MJ[1]:=macd[1];
if (ref(macd,1)<=0 and macd>0) or (ref(macd,1)>=0 and macd<0) and barpos>1 then MJ:=MACD;
if barpos>1 and ref(macd,1)>0 and macd<=0 or ref(macd,1)<0 and macd>=0 then MJ[barpos]:=MJ[barpos-1]+macd[barpos];
drawnumber((refx(macd,1)<=0 and macd>0) or (refx(macd,1)>=0 and macd<0),C,MJ[barpos],0,colormagenta);
是否說明這段代碼沒法改成序列模式?因為我的指標中,還有其他代碼,只能采用序列模式。