請(qǐng)教實(shí)盤交易中的兩個(gè)問題 [金字塔]
- 咨詢內(nèi)容:
runmode:0;
variable:cw=0;input:lots(1,1,100,1);
...
if cw=0 and Short then begin//Short是開空條件
buyshort(1,lots,limitr,o-JumpOffset);//用開盤價(jià)成交
cw:=cw-lots;end
if cw<0 and long then begin//cw是本策略的倉(cāng)位參數(shù),long是開多條件
sellshort(1,lots,limitr,o+JumpOffset);//lots是下單手?jǐn)?shù)
buy(1,lots,limitr,o+JumpOffset);//用開盤價(jià)成交
cw:=cw+2*lots;
end請(qǐng)問:1、原帳戶里有1手空單、策略已是開1手空單狀態(tài),此時(shí)才加載帳戶、其信號(hào)和持倉(cāng)是同步的(但策略實(shí)際并沒執(zhí)行之前的buyshort語句),請(qǐng)問這時(shí)cw是0?還是-1?
2、先用sellshort平空單、再用buy開多單,幾乎是同步發(fā)指令,請(qǐng)問會(huì)不會(huì)導(dǎo)致開多單資金不足呢?(假設(shè)帳戶只夠1手的保證金的話)
謝謝
- 金字塔客服:
1,-1
2,可能會(huì)有影響,可以在開平倉(cāng)語句后面加上orderqueue函數(shù)
- 用戶回復(fù):
請(qǐng)問Just是這樣改嗎?
if cw<0 and long then begin//cw是本策略的倉(cāng)位參數(shù),long是開多條件
sellshort(1,lots,limitr,o+JumpOffset),orderqueue;//lots是下單手?jǐn)?shù)
buy(1,lots,limitr,o+JumpOffset);//用開盤價(jià)成交
cw:=cw+2*lots;
end謝謝
- 網(wǎng)友回復(fù):
哪些高手知道的請(qǐng)回復(fù)一下吧?謝謝
- 網(wǎng)友回復(fù):
每個(gè)下單語句都要加上ordrequeue
如果可以保證第一時(shí)間就會(huì)成交,可以用orderqueue
否則具體方法見 阿火秘笈 日內(nèi)滿倉(cāng)下單的方法
相關(guān)文章
-
沒有相關(guān)內(nèi)容