【问题标题】:Want to create an alert/Expert Advisor or Indicator in MT5 if any pending order get executed如果任何挂单被执行,想要在 MT5 中创建警报/专家顾问或指标
【发布时间】:2021-11-04 10:50:32
【问题描述】:

谁能帮我创建一个指标,如果客户发出限价订单,如买入限价、卖出限价、买入止损或卖出止损,如果订单被执行,那么我应该有声音或没有声音的警报,如果有的话弹出窗口会来,这对我来说也很好。

我一直在寻找过去这么多天的。

您可以查看 MQL PDF 作为参考。

“https://www.mql5.com/files/pdf/mql5.pdf”。

问候, 阿布舍克

【问题讨论】:

    标签: indicator mql5


    【解决方案1】:

    只有 AFAIK 的 EA 可以做到这一点。

    你可以从下面的代码开始:

    void OnTradeTransaction (const MqlTradeTransaction &trans, const MqlTradeRequest &request, const MqlTradeResult &result ) {
       switch(trans.type) {
       case TRADE_TRANSACTION_DEAL_ADD:
          if(HistoryDealSelect(trans.deal)) {
             entry = (ENUM_DEAL_ENTRY)HistoryDealGetInteger(trans.deal, DEAL_ENTRY);
             if(entry == DEAL_ENTRY_IN)
                onDeal(trans); // An order was opened
          }
          break;
       }
    }
    
    void onDeal(const MqlTradeTransaction &trans) {
       // Your code goes here, e.x. Sound
       PlaySound("news.wav")
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-08
      • 2014-03-06
      • 1970-01-01
      • 1970-01-01
      • 2020-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多