[原創]提前下單再請教 [金字塔]
- 咨詢內容:
一個策略里面有兩套系統,其中一套要求條件(long1/short1)一觸發就下單,而另外一套要求條件(long2/short2)觸發后在K線走完前提前N秒下單,圖表交易時用“固定時間間隔1秒”輪詢模式,下面代碼是否正確?請老師指點:tqxiadan:=(time0-timetot0(dynainfo(207))<=N) or not(islastbar);//提前下單秒數 //開多 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第八個
- 用戶回復:
請金哲老師看看我寫的代碼對不對,我就是參考阿火老師的代碼寫的。
- 網友回復:
一個策略里面有兩套系統,其中一套要求條件(long1/short1)一觸發就下單,而另外一套要求條件(long2/short2)觸發后在K線走完前提前N秒下單,圖表交易時用“固定時間間隔1秒”輪詢模式,下面代碼是否正確?請老師指點:tqxiadan:=(time0-timetot0(dynainfo(207))<=N) or not(islastbar);//提前下單秒數 //開多 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 - 網友回復:
這個用在后臺穩妥,圖表有風險
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容