如何在限定時(shí)間內(nèi)不成交即撤單?、這個(gè)功能如何實(shí)現(xiàn),求具體的代碼?? [金字塔]
- 咨詢內(nèi)容:
fglongorderid=Getlongpendingorder("FG06","ZQ")fglongorderidtime=order.OrderInfoTime2(fglongorderid)上面兩行,我已經(jīng)取得了未成交單子的單號(hào)和委托的時(shí)間,假如說(shuō)我要委托后十秒鐘不能成交就撤單,我該怎么寫?
- 金字塔客服:
Sub OrderCheDan() '獲取未成交單,指定秒數(shù)后撤單
PendingCount=Order.OrderNum2
For i=0 to PendingCount-1
Call Order.OrderInfo2(i,OrderID,ConSign,Filled,Remaining,Action,OrderType,LmtPrice,Account,Kaiping,Code,Market)
'application.MsgOut Cdate(time) & ",sAction:" & sAction & ",sKaiping:" & sKaiping & ",LmtPrice:" & LmtPrice & ",OrderID:" & OrderID
OrdTime=right(Order.OrderInfoTime2(i),8)
'application.MsgOut "OrdTime:"&OrdTime
if Datediff("s",OrdTime,Cdate(time))>10 then '大于10秒撤單
Call Order.CancelOrder( OrderID)
end if
Next
End Sub - 用戶回復(fù):
請(qǐng)教版主一下,如果是我要取得某一個(gè)品種的空頭多倉(cāng)或者空倉(cāng)的未成交單子,請(qǐng)問(wèn)這樣子的寫法對(duì)嗎??Function Getshortpendingorder(Scode,Smarket) '獲取未成交單Dim Orderid '訂單IdDim Filled '提交手?jǐn)?shù)Dim Remaining '剩余手?jǐn)?shù)Dim Action '買賣Dim Ordertype '訂單類型Dim Lmtprice '委托價(jià)Dim Account1 '賬戶Dim Kaiping '開(kāi)平Getshortpendingorder=0Pendingcount=Order.Ordernum2For i=0 To Pendingcount-1 Call Order.Orderinfo2(i,Orderid,Consign,Filled,Remaining,Action,Ordertype,Lmtprice,Account1,Kaiping,Code,Market) If Code=Scode and action=1 and kaiping=0 Then GETshortPENDINGORDER=ORDERID End If if Code=Scode and action=0 and kaiping=2 then GETshortPENDINGORDER1=ORDERID end ifNextEnd Function
- 網(wǎng)友回復(fù):
寫錯(cuò)了,應(yīng)該是取得空頭的開(kāi)倉(cāng)單子或者平倉(cāng)單子?
- 網(wǎng)友回復(fù): 請(qǐng)問(wèn)你給的代碼當(dāng)中的 OrdTime=right(Order.OrderInfoTime2(i),8)是什么意思呢?
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容