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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件高级功能研发区 → 为什么用自己写的窗口下单,会弹出确认框?

   

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


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

主题:为什么用自己写的窗口下单,会弹出确认框?

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


加好友 发短信
等级:新手上路 帖子:21 积分:0 威望:0 精华:0 注册:2013/8/29 10:27:59
  发帖心情 Post By:2013/8/29 10:57:57 [显示全部帖子]

if not hangqing is nothing then

         ctp=Order.StockType(symbol,matketID)
         if ctp=1 then
            strDate = Cstr(hangqing.Date)
            'test_tuoke_Label5.caption = strDate
            
            dim num
    dim orderid
    dim ConSign
    dim Filled
    dim R1
    dim Action
    dim OrderType
    dim LmtPrice
    dim Account
    dim Kaiping
    num = Order.OrderInfoByCode2(hangqing.Label,hangqing.marketName, orderid, ConSign, Filled, R1, Action, OrderType, LmtPrice, Account, Kaiping)
    application.MsgOut num
    if num > 1 then
     if lastOrderID = orderid then
      CancelCount = CancelCount + 1
     else
      CancelCount = 0
      lastOrderID = orderid
     end if
     if (CancelCount > 2) then
      call Document.DebugFile("D:\OrderLog.Txt", "CancelOrder:%.2f",orderid )
      call Order.CancelOrder(orderid)
      CancelCount = 0
     end if
    end if
         
            if CountIndex > 5 then
             dim BuyHoding
     dim BuyTodayHoding
     dim SellHoding
     dim SellTodayHoding
     dim BuyCost
     dim SellCost
     dim PNL
     Dim UseMargin
             call Order.HoldingInfoByCode2(hangqing.label,hangqing.marketname,BuyHoding,BuyCost,BuyTodayHoding,SellHoding,SellCost,SellTodayHoding,PNL,UseMargin)
             if BuyHoding > 0 then
              application.MsgOut  hangqing.LowerLimitPrice
              application.MsgOut  hangqing.NewPrice
              msg = "Sell= " & hangqing.LowerLimitPrice
              msg = msg & "  BuyHoding=" & BuyHoding
              msg = msg & "  num= " & num
              call Document.DebugFile("D:\OrderLog.Txt", msg,1)
              call Order.Sell(0,BuyHoding,hangqing.LowerLimitPrice,0,hangqing.label,hangqing.marketname,"",0)
              CountIndex = 0
              
             end if
            end if
            txt = " Buy= " & hangqing.UpperLimitPrice
            call Document.DebugFile("D:\OrderLog.Txt", txt, 1)
            call Order.Buy(0,lots,hangqing.UpperLimitPrice,0,hangqing.label,hangqing.marketname,"",0)
            CountIndex = CountIndex + 1
            
         elseif ctp=0 then
          msgbox "IB账户不支持交易"
   end if
   
  end if  


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


加好友 发短信
等级:新手上路 帖子:21 积分:0 威望:0 精华:0 注册:2013/8/29 10:27:59
  发帖心情 Post By:2013/8/29 10:58:18 [显示全部帖子]

if not hangqing is nothing then
   'test_tuoke_Label1.caption = hangqing.NewPrice
         ctp=Order.StockType(symbol,matketID)
         if ctp=1 then
            strDate = Cstr(hangqing.Date)
            'test_tuoke_Label5.caption = strDate
           
            'dim num
    'dim orderid
    'dim ConSign
    'dim Filled
    'dim R1
    'dim Action
    'dim OrderType
    'dim LmtPrice
    'dim Account
    'dim Kaiping
    'num = Order.OrderInfoByCode2(hangqing.Label,hangqing.marketName, orderid, ConSign, Filled, R1, Action, OrderType, LmtPrice, Account, Kaiping)
    'if num > 1 then
     'if lastOrderID = orderid then
      'CancelCount = CancelCount + 1
     'else
      'CancelCount = 0
      'lastOrderID = orderid
     'end if
     'if (CancelCount > 2) then
      'call Document.DebugFile("D:\OrderLog.Txt", "CancelOrder:%.2f",orderid )
      'call Order.CancelOrder(orderid)
      'CancelCount = 0
     'end if
    'end if
         
            if CountIndex > 5 then
             dim BuyHoding
     dim BuyTodayHoding
     dim SellHoding
     dim SellTodayHoding
     dim BuyCost
     dim SellCost
     dim PNL
     Dim UseMargin
             call Order.HoldingInfoByCode2(hangqing.label,hangqing.marketname,BuyHoding,BuyCost,BuyTodayHoding,SellHoding,SellCost,SellTodayHoding,PNL,UseMargin)
             if SellHoding > 0 then
              application.MsgOut  hangqing.UpperLimitPrice
              application.MsgOut  hangqing.NewPrice
              msg = "SellShort= " & hangqing.UpperLimitPrice
              msg = msg & "  SellHoding=" & SellHoding
              msg = msg & "  num= " & num
              call Document.DebugFile("D:\OrderLog.Txt", msg,0)
              call Order.SellShort(0,SellHoding,hangqing.UpperLimitPrice,0,hangqing.label,hangqing.marketname,"",1)
              'msgbox hangqing.UpperLimitPrice
              'msgbox SellHoding
              CountIndex = 0 
             end if
            end if
            txt = " BuyShort= " & hangqing.NewPrice
            call Document.DebugFile("D:\OrderLog.Txt", txt, 0)
            call Order.BuyShort(0,lots,hangqing.NewPrice,0,hangqing.label,hangqing.marketname,"",1)
            CountIndex = CountIndex + 1
            
         elseif ctp=0 then
          msgbox "IB账户不支持交易"
   end if
  end if

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


加好友 发短信
等级:新手上路 帖子:21 积分:0 威望:0 精华:0 注册:2013/8/29 10:27:59
  发帖心情 Post By:2013/8/29 10:59:46 [显示全部帖子]

2楼的代码直接下单,3楼的代码就会弹出一楼的提示。

是在搞不懂这连个代码有什么区别。

注销部分是撤单的部分,应该不影响。


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


加好友 发短信
等级:新手上路 帖子:21 积分:0 威望:0 精华:0 注册:2013/8/29 10:27:59
  发帖心情 Post By:2013/8/29 11:24:20 [显示全部帖子]

这个和交易时段没关系,两段代码今天一直是这个情况。


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


加好友 发短信
等级:新手上路 帖子:21 积分:0 威望:0 精华:0 注册:2013/8/29 10:27:59
  发帖心情 Post By:2013/8/29 13:24:22 [显示全部帖子]

谢谢!看到了。


 回到顶部