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


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

   

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


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

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

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


加好友 发短信
等级:超级版主 帖子:18691 积分:0 威望:0 精华:0 注册:2013/7/15 9:22:16
为什么用自己写的窗口下单,会弹出确认框?  发帖心情 Post By:2013/8/29 10:04:56 [只看该作者]

请教
为什么用自己写的窗口下单,会弹出确认框?
昨天还没有,今天改了几句代码就这样

图片点击可在新窗口打开查看此主题相关图片如下:13.jpg
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
jingcha
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | 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
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | 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
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


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

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

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

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


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


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

非交易时段下单时,就是会弹出对话框的,因为需要对话框弹出让你来调整预埋单还有价格


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

金字塔-技术部

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

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

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


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

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


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


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

Buy 方法

开多操作

Buy(Type,Vol,Price,StoplmtPrice,Code,Market,AccountID,Valid)

Type            委托类型,分别可为 0限价 1市价 2停损 3限价停损

Vol               委托数量

Price           委托价格,当Type为2和3时为停损价格

StoplmtPrice    停损限价,当Type为3时必须指定停损限价

Code            品种代码,如 "600215"

Market          品种市场,如"SH"表示上海市场

AccountID       指定帐户,为空表示当前帐户

Valid           为1表示下单时弹出确认对话框,为0表示直接下单到服务器



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

金字塔-技术部

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

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

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


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

谢谢!看到了。


 回到顶部