大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频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)容
主站蜘蛛池模板: 波多野结衣一二三区 | 尤物视频在线 | 欧美一级在线播放 | 欧美成人综合 | 日韩免费视频一区二区 | 俄罗斯老妇性欧美毛茸茸孕交 | 在线看片黄色 | 性感美女一级毛片 | 国产国产成人人免费影院 | 欧美性白人顶级hd | 在线免费一级片 | 欧美区视频| 在线亚洲 欧美 日本专区 | 天天综合在线视频 | 国产亚洲一区在线 | 欧美成人精品高清在线播放 | 中国国语毛片免费观看视频 | 国产成人久久精品区一区二区 | 欧美一区二区影院 | 九九在线观看免费视频 | 色18美女社区 | 亚洲综合a | 一级毛片在线播放 | 亚洲午夜日韩高清一区 | 欧美成人精品第一区二区三区 | 伊人影院综合 | 黄片一级毛片 | 四虎影院久久久 | 亚洲涩涩精品专区 | 天天射天天操天天干 | 中文字幕视频在线 | 亚洲日韩在线视频 | 九九热精品免费视频 | 精品久久久久久久久久 | 一区二区三区在线免费视频 | www国产视频| 毛片网站免费在线观看 | 欧美大黄大色一级毛片出红 | 成人精品亚洲 | 狠狠色噜噜狠狠狠狠97不卡 | 一级免费毛片 |