大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 其他期貨軟件知識>>正文內(nèi)容

怎樣用VBS實(shí)現(xiàn)指定賬戶權(quán)益低于90萬時強(qiáng)行平倉? [金字塔]

  • 咨詢內(nèi)容:

    如題

     

  • 金字塔客服:

    樓主可以打開幫助參考下VBA中的Order對象

    另外軟件內(nèi)下單設(shè)置——止盈止損中中也是可以設(shè)置的

     

  • 用戶回復(fù):

     

  • 網(wǎng)友回復(fù):

    使用VBA編寫的代碼量較大,在此無法給你編寫完整的,給出你一個實(shí)現(xiàn)的想法思路

     

    1、你應(yīng)該了解金字塔VBA的定時器功能,定期1秒檢測帳戶的動態(tài)權(quán)益,有關(guān)定時器的部分論壇已經(jīng)很多討論了,你可以自行搜索一下

    2、這里給你摘抄部分的判斷動態(tài)權(quán)益全部強(qiáng)平的部分代碼

     

    IsAlarm = 0'是否已經(jīng)有過預(yù)警動作

     dynamicpower= order.Account2(6,account)'得到賬戶動態(tài)權(quán)益
     cash= order.Account2(3,account)'得到賬戶里的現(xiàn)金余額

    '//////////////////////////////////////////////////////////////////////////////////////////達(dá)到全平警戒線 強(qiáng)平資金:103,5000        當(dāng)前權(quán)益只有103.5W的時候強(qiáng)平當(dāng)前所有持倉
     if dynamicpower<Forced_liquidation_capital and Count1 + Count2 > 0 then
         application.PlaySoundFile "OrderNotify.wav"
            IsAlarm = 1
      Forced=1
      
      if count1 > 0 Or Count2 > 0 then
       application.MsgOut "強(qiáng)平"&Account&"賬戶所有持倉"
       application.MsgOut "動態(tài)權(quán)益: "&dynamicpower
       application.MsgOut "強(qiáng)平資金: "&Forced_liquidation_capital
      
       Document.DebugFile "C:\OrderLog.txt","執(zhí)行了強(qiáng)平:"&Account&"賬戶所有持倉", 1
      End if
      
    '//////////////////////////////////////////////////////////////////////////////////////////全平操作
      dim BuyHoding
      dim BuyCost
      dim BuyTodayHoding
      dim SellHoding
      dim SellCost
      dim SellTodayHoding
      dim PNL
      dim UseMargin
      dim Code
      dim Market
        

     for i=0 to count1 - 1

      Result = Order.HoldingInfo2(i,BuyHoding,BuyCost,BuyTodayHoding,SellHoding,SellCost,SellTodayHoding,PNL,UseMargin ,Code,Market)
      If Result <> 1 Then
       exit sub
      End If
     
         set Report1 = marketdata.GetReportData(Code,Market)
         'application.MsgOut Report1.NewPrice

        if  BuyHoding<>0 then
         call order.Sell(1,BuyHoding,Report1.NewPrice,0,Code,Market,account,0)
         application.MsgOut "品種:"&Code & "   平多:"&BuyHoding &"  賬戶:"&account
        end if
      if  SellHoding<>0 then
         call order.Sellshort(1,SellHoding,Report1.NewPrice,0,Code,Market,account,0)
         application.MsgOut  "品種:"&Code & "    平空:"&SellHoding&"  賬戶:"&account   
      end if  
     next
     
     for i=0 to count2 - 1

      Result = Order.HoldingInfo(i, BuyHoding, BuyCost, BuyTodayHoding, SellHoding, SellCost, PNL, Code, Market)
      If Result <> 1 Then
       exit sub
      End If
     
         set Report1 = marketdata.GetReportData(Code,Market)
         'application.MsgOut Report1.NewPrice

        if  BuyHoding>0 then
         call order.Sell(1,BuyHoding,Report1.NewPrice,0,Code,Market,account,0)
         application.MsgOut "品種:"&Code & "   平多:"&BuyHoding &"  賬戶:"&account
      end if
      if  BuyHoding<0 then
         call order.Sellshort(1,BuyHoding,Report1.NewPrice,0,Code,Market,account,0)
         application.MsgOut "品種:"&Code & "   平空:"&abs(BuyHoding) &"  賬戶:"&account

      end if  
     next
        
    end if

 

如果以上指標(biāo)公式不適用于您常用的行情軟件

或者您想改編成選股公式,以便快速選出某種形態(tài)個股的話,

可以聯(lián)系我們相關(guān)技術(shù)人員 QQ: 262069696  點(diǎn)擊在線交流進(jìn)行 有償 改編!

 


【字體: 】【打印文章】【查看評論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 自拍第二页 | 久久精品啪啪嗷嗷叫 | 精品不卡 | 国产精品香蕉在线一区二区 | 七七久久 | 亚洲国产精品一区二区不卡 | 久久久精品国产 | 全高清特级毛片 | 久久99精品一级毛片 | 亚洲香蕉| 久久精品国产一区二区三区日韩 | 亚洲国产麻豆 | 四虎ww| 国产午夜影院 | 国产精品久久久久久久网站 | 福利在线网站 | 国产成人精品在线观看 | 不卡免费在线视频 | 国产在热线精品视频国产一二 | 久久久久久久尹人综合网亚洲 | 国内精品久久久久久久97牛牛 | 一本色道久久综合亚洲精品 | 精品乱码一区二区三区四区 | 天天干天天插 | 不卡中文字幕在线观看 | 97精品国产 | 奇米影视亚洲狠狠色777不卡 | 国产精品成人在线 | 亚洲qingse中文在线 | 涩涩一区| 国产精品九九久久精品女同 | 福利社91 | 久久综合久美利坚合众国 | 亚洲成人免费视频在线 | 欧美日日射 | 2019av在线视频 | 久久综合中文字幕一区二区 | 9999在线视频 | 国产精品欧美亚洲韩国日本不卡 | 国产一区二区高清在线 | 深夜在线观看 |