請問一下,在序列模式下,標注MACD紅綠柱面積的代碼,錯在哪? [金字塔]
- 咨詢內(nèi)容:
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) then MJ:=MACD;
else 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); - 金字塔客服:
數(shù)組用序列,就會最后一根值全部往前賦值成一個值。
下列公式用逐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); - 用戶回復(fù):
是否說明這段代碼沒法改成序列模式?因為我的指標中,還有其他代碼,只能采用序列模式。
- 網(wǎng)友回復(fù): 不能用序列,或者說序列很難改,和數(shù)組的賦值思路相反 [此貼子已經(jīng)被作者于2013/7/23 9:08:01編輯過]
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容