后臺編寫問題請教 [金字塔]
- 咨詢內容:
RSV:= (CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100;
K:=SMA(RSV,M1,1);
D:=SMA(K,M2,1);
J:=3*K-2*D;
cond1:=CROSS(K,D);//開多條件
cond2:=CROSS(D,K);//開空條件tbuy(time=090100,100,lmt,o,0);
tbuyshort(time=090100,100,lmt,o,0);tsell(cond1,10,mkt);
tsellshort(cond2,10,mkt);1)若其中有單子沒有成交,撤單并且以市價平掉這筆單子。
2)當持倉為0時,在繼續重復第一次開多開空同等數量。繼續執行程序。
這樣編寫對否?
還有后臺使用ORDERQUEUE可以否?
if TISREMAIN(0)>0 then begin
tsell(TCANCEL(1,0),10,mkt);
tsellshort(TCANCEL(1,0),10,mkt);
End
if THOLDING2=0 then begin
tbuy(CURRENTTIME,100,lmt,O,0);
tbuyshort(CURRENTTIME,100,lmt,O,0);
End
tsell(cond1,10,mkt);
tsellshort(cond2,10,mkt);if CURRENTTIME=145800 then
tsell(1,0,mkt);
tsellshort(1,0,mkt); - 金字塔客服:
若編寫錯誤,應該如何編寫請賜教,謝謝
- 用戶回復:
1.單子沒成交那你應該是撤單而不是平倉啊,你沒成交哪里能夠平單子
if tisremain(0)>0 then
tcancel(1,0);
end
2. orderqueue可以用在后臺
3. 時間判斷時,用time可以用=判斷,可以time=090100;
但是用currenttime,你需要用一個時間段來控制,比如這樣 currenttime>145800 and currenttime<=145900
- 網友回復:
if tisremain(0)>0 then begin tcancel(0,0); tsell(1,10,mkt); tsellshort(1,10,mkt);end if tisremain(0)>0 then begin tcancel(0,0); tsell(1,10,mkt); tsellshort(1,10,mkt);end
if THOLDING2=0 and currenttime>144000 then begintbuy(1,100,lmt,O,0);tbuyshort(1,100,lmt,O,0);Endtsell(cond1,10,mkt);tsellshort(cond2,10,mkt);
if CURRENTTIME=145800 then
tsell(1,0,mkt);
tsellshort(1,0,mkt);這樣可以了嗎? 老大
- 網友回復: 這樣可以了嗎?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容