Unlocking the Altarius RSI Stochastic: Your Ultimate MetaTrader 5 EA

Mike 2017.03.02 18:51 41 0 0
Attachments

The Altarius RSI Stochastic EA is a powerful tool designed for traders using MetaTrader 5. This Expert Advisor combines two Stochastic Oscillator indicators with one Relative Strength Index (RSI) to enhance your trading strategy.

Creator Insights — The brains behind this idea is cxa, while the MQL5 code was crafted by barabashkakvn.

This EA optimizes lot sizes based on a thorough analysis of your closed trades. Here’s a quick look at how it computes the optimal lot size:

//+------------------------------------------------------------------+
//| Calculating optimal lot size |
//+------------------------------------------------------------------+
double LotsOptimized()
  {
   double lot=Lots;
   int    losses=0;                  // number of losses deals without a break
//--- select lot size
   lot=NormalizeDouble(m_account.FreeMargin()*MaximumRisk/1000.0,2);
//--- calculate number of losses orders without a break
   if(DecreaseFactor>0)
     {
      //--- request trade history
      HistorySelect(TimeCurrent()-86400,TimeCurrent()+86400);
      //---
      uint     total=HistoryDealsTotal();
      //--- for all deals
      for(uint i=0;i<total;i++)
        {
         if(!m_deal.SelectByIndex(i))
           {
            Print("Error in history!");
            break;
           }
         if(m_deal.Symbol()!=Symbol() || m_deal.Entry()!=DEAL_ENTRY_OUT)
            continue;
         //---
         if(m_deal.Profit()>0)
            break;
         if(m_deal.Profit()<0)
            losses++;
        }
      if(losses>1)
         lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
     }
//--- return lot size
   if(lot<0.1)
      lot=0.1;
   return(lot);
  }

Check out the backtest results on EURUSD and USDJPY:

Altarius RSI Stohastic USDJPY, H1 

Altarius RSI Stohastic EURUSD,H1 

Altarius RSI Stohastic USDJPY,M15 

Altarius RSI Stohastic EURUSD,M15 

List
Comments 0