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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件高级功能研发区 → [求助]请问下VBA的order对象需要专业版才能使用,那意思是免费版无法通过VBA来做程序化交易?

   

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


  共有3436人关注过本帖平板打印复制链接

主题:[求助]请问下VBA的order对象需要专业版才能使用,那意思是免费版无法通过VBA来做程序化交易?

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


加好友 发短信 ateam
等级:论坛游侠 帖子:414 积分:0 威望:0 精华:0 注册:2016/12/8 10:33:23
  发帖心情 Post By:2016/12/19 16:53:18 [只看该作者]

下面这代码,开仓条件应该是恒成立的,但运行后什么反应都没

Sub TLStart()
  call marketdata.RegReportNotify("IC00","ZJ")
  call marketdata.RegReportNotify("IF00","ZJ")
End Sub

Sub MARKETDATA_ReportNotify()
  Set Report1 = marketdata.GetReportData("IC00","ZJ")
  Set Report2 = marketdata.GetReportData("IF00","ZJ")
  msgbox Report1.SellPrice1
  msgbox Report2.BuyPrice1
  dim BuyHoding1
  dim BuyHlding2
  dim BuyTodayHoding1
  dim BuyTodayHoding2
  dim SellHoding1
  dim SellHoding2
  dim SellTodayHoding1
  dim SellTodayHoding2
  dim BuyCost
  dim SellCost
  dim PNL
  Dim UseMargin
  call Order.HoldingInfoByCode2("IC00","ZJ",BuyHoding1,BuyCost,BuyTodayHoding1,SellHoding1,SellCost,SellTodayHoding1,PNL,UseMargin)
  call Order.HoldingInfoByCode2("IF00","ZJ",BuyHoding2,BuyCost,BuyTodayHoding2,SellHoding2,SellCost,SellTodayHoding2,PNL,UseMargin)
 

  Diff = Report1.SellPrice1 - Report2.BuyPrice1 '分别取卖价和买价计算差价 
  if Diff > 2800 and BuyHoding1 = 0 then
  call Order.Buy(0,1,Report1.SellPrice1,0,"IC00","ZJ","",0)
  call Order.BuyShort(0,1,Report2.BuyPrice1,0,"IF00","ZJ","",0)
  end if

  Diff = Report1.BuyPrice1 - Report2.SellPrice1
  if diff < 2800 and BuyHoding1 > 0 then
  call Order.Sell(0,1,Report1.BuyPrice1,0,"IC00","ZJ","",0)
  call Order.Sellshort(0,1,Report2.SellPrice1,0,"IF00","ZJ","",0)
  end if
End Sub

 回到顶部
总数 19 1 2 下一页