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