打印本文打印本文 关闭窗口关闭窗口

[求助]谁能帮我修改一下阿火的VBA跟单程序?

作者:金字塔 来源:cxh99.com 发布时间:2015年03月12日
  • 咨询内容:  http://www.weistock.com/bbs/dispbbs.asp?boardid=10&id=9439&authorid=1617&page=0&star=3
    原版出处在这里~

    十六、CTP账户的跟单VBA代码

    B账户跟着A账户做单(前提是知道A账户的密码,在同一个金字塔同时登陆A账户和B账户)

    Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
    if Status="Tradeing" and filled>0 and Account="8000000000" then
    if aspect=0 then
    if kaiping=0 then order.Buy 1,filled,0,0,code,market,"800000",0
    if kaiping>0 then order.sellshort 1,filled,0,0,code,market,"800000",0
    end if
    if aspect=1 then
    if kaiping=0 then order.Buyshort 1,filled,0,0,code,market,"800000",0
    if kaiping>0 then order.sell 1,filled,0,0,code,market,"800000",0
    end if
    end if
    End Sub

    跟单代码如上~
    现在需要实现B账户跟踪A账户下单~
    但是保持B账户是A账户持仓的三分之一
    具体思路是

    A账户下单某合约成交后~
    查询B账户与A账户在该合约上的持仓~
    保持该合约上B账户持仓为A账户的三分之一
    多了就平少了就补~


     

  • 金字塔客服:  帮个忙啊
    都悬赏了的

     

  • 用户回复:  两个账户能否改一下用
    ac1:="800000";
    ac2:="8000000000"
    这样表示?

     

  • 网友回复:

    VBA的问题需要一定时间安排处理,请不要急躁,谢谢

     

  • 网友回复: 我是觉得这个程序对于有vba基础的人来说简直小菜啊~

    至少有人回帖了~
    谢谢~
打印本文打印本文 关闭窗口关闭窗口