Created by: Hazem — MQL5 Code Author: barabashkakvn.
The real challenge with this code lies in comparing the iCCI and iMACD values against the "Buy Sell Level" variable. You might find that these indicator values differ significantly, sometimes by multiples.
Take a look at the example for pairs like EURUSD, USDJPY, and USDSEK across all timeframes available in MetaTrader 5:


As you can see, the iCCI readings are relatively stable, while iMACD is heavily influenced by the price action of the symbol. To tackle this, we can adjust iMACD values by multiplying them with a ratio:
{
//----
m_ext_lot=NormalizeDouble(m_account.Balance()/50001.0,2);
if(m_ext_lot<0.1)
m_ext_lot=0.1;
m_cci=iCCIGet(0);
m_macd=iMACDGet(MAIN_LINE,0)*1000000;
m_buy_total=0;
m_sell_total=0;

Pro Tip: Try using EURUSD on the M30 timeframe for optimal results.
Here are the results from January 8, 2016, to November 6, 2016, using EURUSD on the M30 timeframe with an initial deposit of $10,000:

Comments 0