Home System Trading Post

Mastering the Breadandbutter2 EA for MetaTrader 5: A Trader's Guide

Attachments
22003.zip (4.31 KB, Download 0 times)

Meet the Creator: Scriptor

MQL5 Code Contributor: barabashkakvn

The Breadandbutter2 is an expert advisor (EA) designed for MetaTrader 5 that leverages the iADX (Average Directional Movement Index) and iAMA (Adaptive Moving Average) indicators. This EA kicks into gear when a new bar forms, and it smartly closes any opposing positions upon receiving a trading signal.

Finding the Optimal Parameters

When it comes to tuning the parameters for your specific currency pair and timeframe, you have two avenues:

  • Manual Tuning: You can adjust the "<" and ">" operators in the signal equations:
   if(adx_0<adx_1 && ama_0>ama_1)
     {
      ClosePositions(POSITION_TYPE_SELL);
      double sl=(InpStopLoss==0)?0.0:m_symbol.Ask()-ExtStopLoss;
      if(sl>=m_symbol.Bid()) // incident: the position isn't opened yet, and has to be already closed
        {
         PrevBars=0;
         return;
        }
      double tp=(InpTakeProfit==0)?0.0:m_symbol.Ask()+ExtTakeProfit;
      OpenBuy(sl,tp);
      return;
     }

   if(adx_0>adx_1 && ama_0<ama_1)
     {
      ClosePositions(POSITION_TYPE_BUY);
      double sl=(InpStopLoss==0)?0.0:m_symbol.Bid()+ExtStopLoss;
      if(sl<=m_symbol.Ask()) // incident: the position isn't opened yet, and has to be already closed
        {
         PrevBars=0;
         return;
        }
      double tp=(InpTakeProfit==0)?0.0:m_symbol.Bid()-ExtTakeProfit;
      OpenSell(sl,tp);
      return;
     }
  • Automatic Tuning: This method allows the EA to automatically select the stop loss, take profit, and the horizontal shift for the AMA indicator.

Breadandbutter2

Related Posts

Comments (0)