欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件高级功能研发区 → VBA中的查询资金和账户?

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4175人关注过本帖树形打印复制链接

主题:VBA中的查询资金和账户?

帅哥哟,离线,有人找我吗?
solarhe2006
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:252 积分:1001 威望:0 精华:0 注册:2010/2/15 16:47:58
VBA中的查询资金和账户?  发帖心情 Post By:2013/12/25 14:58:00 [只看该作者]

VBA中的查询资金和账户?
在CTP柜台中有查询间隔一秒的限制,那么金字塔VBA中的
order.account2(6,myaccount)和Call order.HoldingInfoByCode2中查询的持仓情况是不是会因为查询时间的限制,得到的不是最新资金和持仓,这个情况在一分钟以上交易没关系,在TICK驱动高频交易时候(500毫秒)下就最好不去查询资金和账户。

 回到顶部
帅哥哟,离线,有人找我吗?
王锋
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:11808 积分:20695 威望:0 精华:10 注册:2009/8/18 8:15:13
  发帖心情 Post By:2013/12/25 16:28:11 [只看该作者]

不会的,你调用金字塔函数时,都是从内部调用的,不会去查询


金字塔—专业程序化软件提供商

金字塔-技术部

-----------------------------------------------------------------------------------------------------

工作时间:周一至周五 08:30 - 17:30   周末及法定节假日休息

Email:service@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
solarhe2006
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:252 积分:1001 威望:0 精华:0 注册:2010/2/15 16:47:58
  发帖心情 Post By:2013/12/25 16:33:36 [只看该作者]

不会去查询的话,实时的账户资金变动和持仓变动是如何得出来的呢?VBA下请详细说下?


 回到顶部
帅哥哟,离线,有人找我吗?
王锋
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:11808 积分:20695 威望:0 精华:10 注册:2009/8/18 8:15:13
  发帖心情 Post By:2013/12/25 16:50:42 [只看该作者]

交易有变动时,金字塔会自动对账户进行计算,也不会没事就到柜台去查询,查询是个很慢的过程,无法满足及时性需要的



金字塔—专业程序化软件提供商

金字塔-技术部

-----------------------------------------------------------------------------------------------------

工作时间:周一至周五 08:30 - 17:30   周末及法定节假日休息

Email:service@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
solarhe2006
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:252 积分:1001 威望:0 精华:0 注册:2010/2/15 16:47:58
  发帖心情 Post By:2013/12/25 20:41:59 [只看该作者]

交易有变动时,相当于事件驱动,请问是那个事件呢?

1、OnTrade委托回报

2、OnOrder

成交回报 

3、OnOrderRejected委托拒绝回报

4、OnOrderCanceled撤单成功回报

5、OnCancelOrderFailed撤单失败回报

还是

Status         订单的变化类型,有如下字符串值:

                 "Cancelled"  表示订单已经撤销

                 "Submitted"和"PreSubmitted"  表示订单已经提交,当只成交一部分尚未完全成交时也会出现此事件,此时已成交数量在Filled参数中显示

                 "Filled"    表示本地订单已经全部成交

                 "Tradeing"  每笔成交回报,此时Filled是本次成交数量,Remaining将始终为0

                 "Inactive"  表示本次委托无效,比如价格超过允许范围,委托数量超出范围等等



 回到顶部
帅哥哟,离线,有人找我吗?
z7c9
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
  发帖心情 Post By:2013/12/26 6:11:09 [只看该作者]

Sub order_orderstatusex2(orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype)
mystatus=LCase(status)
Select Case LCase(status)
Case "submitted"
onsendorder orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
application.msgout Now&"<下单成功>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "inactive"
onsendorderfailed orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
application.msgout Now&"<下单失败>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "cancelled"
oncancelorder orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
application.msgout Now&"<撤单成功>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "tradeing"
ontrade orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
application.msgout Now&"<成交回报>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "filled"
application.msgout Now&"<全部成交>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "connected"
application.msgout Now&"<账号连接>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case "disconnected"
application.msgout Now&"<账号断开>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
Case Else
application.msgout Now&"<异常情况>"&mystatus
'printorderstatus orderid,status,filled,remaining,price,code,market,ordertype,aspect,kaiping,account,accounttype
End Select
End Sub

 回到顶部
帅哥哟,离线,有人找我吗?
solarhe2006
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:252 积分:1001 威望:0 精华:0 注册:2010/2/15 16:47:58
  发帖心情 Post By:2013/12/26 14:35:52 [只看该作者]

交易有变动时,金字塔会自动计算,那么如果金字塔的资金和持仓是计算出来的,如果我一个帐号在两个地方登陆,其中一个地方手工下单,金字塔监控不到的话,就计算不了呀??

 回到顶部