因为4.1存在软件崩溃的问题,我把软件升级到4.2,但是却出现了下套利对订单ID重复的问题,输出的消息窗口显示cu跟ni订单ID都是705873434,但是从交易日志来看却不是这样的。请问这是什么问题?代码如下:
dim sendOrder1,sendOrder2,NewPrice1,NewPrice2,Report_CU,Report_NI
Sub TLStart()
'"""注册品种"""
call marketdata.RegReportNotify("CU08", "SQ")
call marketdata.RegReportNotify("NI09", "SQ")
End Sub
Sub MARKETDATA_ReportNotify(ReportData)
'"""处理行情推送"""
set Report_CU = marketdata.GetReportData("CU08", "SQ")
set Report_NI = marketdata.GetReportData("NI09", "SQ")
if ReportData.Label = "CU08" then
NewPrice1 = Report_CU.NewPrice '最新价
NewPrice2 = Report_NI.NewPrice
if time = "14:01:00" then
sendOrder1 = order.Buy(0,1,NewPrice1,0,"CU08", "SQ","",0)
sendOrder2 = order.Buyshort(0,1,NewPrice2,0,"NI09", "SQ","",0)
end if
end if
application.MsgOut time&" ID1:"&sendOrder1&" ID2:"&sendOrder2
end sub
Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
if Status = "Submitted" then
call d.SetKey(OrderID,Price)
end if
在下单事件里当订单提交后,去记录对应的id
刚咨询了下,此处有点小bug。后面会修正
目前您可以按照我上面方式去解决
这个订单号的bug在下个版本修复,大概什么时候会出来呢?
目前4.21正式版已经修复了