以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  VB下的单,OrderStatusEx2没反应  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=6062)

--  作者:fly
--  发布时间:2011/4/8 10:10:29
--  VB下的单,OrderStatusEx2没反应

Sub OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, IndexCode1, Market1, OrderType, Aspect, Kaiping, Account,AccountType)
 \'wg_rst.Open "select * from wg_order",wg_cnn,adOpenKeyset,adLockOptimistic
msgbox time&" ao" 
 wg_rst.Open "select * from wg_order",wg_cnn,1,3
 wg_rst.AddNew

 wg_rst("rq")=DATE
 wg_rst("sj")=TIME
 wg_rst("OrderID")=OrderID
 wg_rst("Status")=Status
 wg_rst("Filled")=Filled
 wg_rst("Remaining")=Remaining
 wg_rst("Price")=Price
 wg_rst("IndexCode1")=IndexCode1
 wg_rst("Market1")=Market1
 wg_rst("OrderType")=OrderType
 wg_rst("Aspect")=Aspect
 wg_rst("Kaiping")=Kaiping
 wg_rst("Account")=Account
 
 wg_rst.update
 wg_rst.close
application.MsgOut time&" "&OrderID
End Sub

 

VB下的单,OrderStatusEx2没反应

msgbox都没有弹出来,请帮忙看看是什么问题,谢谢

 

//下单语句

sub aa1()
set rpt=marketdata.GetReportData("if04","zj")
newprice=rpt.newprice+2

call Order.Buy(0,2,newprice,0,"if04","zj","40009462",0)

end sub

 



--  作者:admin
--  发布时间:2011/4/8 10:15:15
--  

 

Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
  APPLICATION.MsgOut STATUS
End Sub

 

我们通过简单的代码,手工下单是可以收到消息

估计你是其他地方的问题,你试试将代码的数据库部分以及其他一些罗嗦的代码删除,简化代码后看看。

学会用排除法查找问题是每个程序员必备的最基本的能力之一

[此贴子已经被作者于2011-4-8 10:16:44编辑过]

--  作者:wangwatercup
--  发布时间:2011/4/8 13:11:10
--  
是俺搞错了 应该为
Sub Order_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, IndexCode1, Market1, OrderType, Aspect, Kaiping, Account,AccountType)
感谢King的耐心。

以下是引用fly在2011-4-8 10:10:29的发言:

Sub OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, IndexCode1, Market1, OrderType, Aspect, Kaiping, Account,AccountType)
 \'wg_rst.Open "select * from wg_order",wg_cnn,adOpenKeyset,adLockOptimistic
msgbox time&" ao" 
 wg_rst.Open "select * from wg_order",wg_cnn,1,3
 wg_rst.AddNew

 wg_rst("rq")=DATE
 wg_rst("sj")=TIME
 wg_rst("OrderID")=OrderID
 wg_rst("Status")=Status
 wg_rst("Filled")=Filled
 wg_rst("Remaining")=Remaining
 wg_rst("Price")=Price
 wg_rst("IndexCode1")=IndexCode1
 wg_rst("Market1")=Market1
 wg_rst("OrderType")=OrderType
 wg_rst("Aspect")=Aspect
 wg_rst("Kaiping")=Kaiping
 wg_rst("Account")=Account
 
 wg_rst.update
 wg_rst.close
application.MsgOut time&" "&OrderID
End Sub

 

VB下的单,OrderStatusEx2没反应

msgbox都没有弹出来,请帮忙看看是什么问题,谢谢

 

//下单语句

sub aa1()
set rpt=marketdata.GetReportData("if04","zj")
newprice=rpt.newprice+2

call Order.Buy(0,2,newprice,0,"if04","zj","40009462",0)

end sub