請問最后一行代碼有無出錯(cuò)? [金字塔]
- 咨詢內(nèi)容:
請問最后一行代碼有無出錯(cuò)?
variable:bj=0;
tr1 : max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));
atr : ma(tr1,20); //atr公式
ma20:ma(close,20); //20日均線
a1:=0.01*valuewhen(barpos=1,asset); //初始資金的1%
a2:=floor(a1/(2*atr)); //開倉手?jǐn)?shù)
a3:=ref(hhv(high,20),1); //20日高點(diǎn)
if holding=0 and close>a3 and close>ma20 and bj=0
then begin
buy(1,a2,marketr);
bj:=1;
end //第一次開倉
if holidng=0 and close>enterprice+2*atr and bj=1
then begin
buy(1,a2,marketr);
end //請問這里還是if holidng=0嗎?還是應(yīng)該是if holidng>0 ?
- 金字塔客服:
加倉的話要大于0,
等于0是在空倉的情況下用,
- 用戶回復(fù): 好的
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容