[原創(chuàng)]提前下單再請教 [金字塔]
- 咨詢內(nèi)容:
一個策略里面有兩套系統(tǒng),其中一套要求條件(long1/short1)一觸發(fā)就下單,而另外一套要求條件(long2/short2)觸發(fā)后在K線走完前提前N秒下單,圖表交易時用“固定時間間隔1秒”輪詢模式,下面代碼是否正確?請老師指點(diǎn):tqxiadan:=(time0-timetot0(dynainfo(207))<=N) or not(islastbar);//提前下單秒數(shù) //開多 if long1 then begin sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue; buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
//開空 if short1 then begin sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue; buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
if tqxiadan then begin
//開多 if long2 then begin sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue; buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
//開空 if short2 then begin sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue; buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; endend - 金字塔客服:
k線走完提前下單阿火秘笈里面有,跟著寫就行了
http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=9439第八個
- 用戶回復(fù):
請金哲老師看看我寫的代碼對不對,我就是參考阿火老師的代碼寫的。
- 網(wǎng)友回復(fù):
一個策略里面有兩套系統(tǒng),其中一套要求條件(long1/short1)一觸發(fā)就下單,而另外一套要求條件(long2/short2)觸發(fā)后在K線走完前提前N秒下單,圖表交易時用“固定時間間隔1秒”輪詢模式,下面代碼是否正確?請老師指點(diǎn):tqxiadan:=(time0-timetot0(dynainfo(207))<=N) or not(islastbar);//提前下單秒數(shù) //開多 if long1 then begin sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue; buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
//開空 if short1 then begin sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue; buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
if tqxiadan then begin
//開多 if long2 then begin sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue; buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; end
//開空 if short2 then begin sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue; buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue; endend - 網(wǎng)友回復(fù):
這個用在后臺穩(wěn)妥,圖表有風(fēng)險
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容