Function sendOrder(Market, vtSymbol, orderType, Price, Volume, name)
\'"""发单"""
application.MsgOut "调用trade函数"&OrderType
Select Case OrderType
Case 0 \'开多
sendOrder = order.Buy(0,Volume,Price,0,vtSymbol,Market,"",0)
Case 1 \'平多
sendOrder = order.Sell(0,Volume,Price,0,vtSymbol,Market,"",0)
Case 2 \'开空
sendOrder = order.Buyshort(0,Volume,Price,0,vtSymbol,Market,"",0)
Case 3 \'平空
sendOrder = order.Sellshort(0,Volume,Price,0,vtSymbol,Market,"",0)
end Select
application.MsgOut "开仓方向:"&OrderType&" ID:"&sendOrder
orderStrategyDict.Add sendOrder, strategyDict.Item(name) \'保存vtOrderID和策略的映射关系
For Each key In orderStrategyDict \'循环遍历Dictionary键,并输出键值
application.MsgOut key&":"&orderStrategyDict.Item(key).name_get&" "&name
Next
End Function