Unlocking Trading Success with MySystem for MetaTrader 5

Mike 2018.10.26 00:46 20 0 0
Attachments

The brain behind the idea: Collector

MQL5 code creator: barabashkakvn

MySystem is a robust EA that kicks into gear with every new bar. It utilizes signals from the iBullsPower (Bulls Power) and iBearsPower (Bears Power) indicators, but only if there are no open positions from the EA. This is determined by the current symbol and the unique EA identifier known as the magic number.

These indicators come with a single setting: Bulls and Bears: averaging period. The algorithm for forming trading signals pulls data from two bars—the current bar and the next bar (current + 1)—and averages their values.

   double prev = ((bears[1]+bulls[1])/2.0);
   double curr = ((bears[0]+bulls[0])/2.0);

If the average value from the previous bar is lower than that of the current bar, it will trigger a BUY order:

      if(prev<curr && curr<0)
        {
         //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;
        }

Conversely, if the average from the previous bar surpasses the current one, a SELL order will be executed:

      if(prev>curr && curr>0)
        {
         //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;
        }

Here's a quick look at how MySystem performs on the EUR/USD pair in a 15-minute timeframe:

MySystem

List
Comments 0