• Overview
  • Reviews
  • Comments (2)
  • What's new

MAC Moving Average Convergence

The trade signals of Moving Average Convergence (MAC) are based on setup of Moving Average (MA) and SAR indicators. The signal is generated when the trendline of fast MA crosses over trendline of slow MA and the trend is confirmed by EMA and SAR indicators.

One can use static stop loss, take profit and trailing stop values, but I recommend to use variable values based on ATR indicator. You may enter the multipliers for ATR values and the ATR period value.

Sizing option is available. If it is checked, the lot size is automatically calculated depending on a chosen risk and a stop loss value.

The time filter option is available. You can define the start hour in Monday and the end hour in Friday for the robot to generate the signals.

The best input values for each pair and timeframe will be uploaded in comments. Also, you can see some results in the screenshots below. It is quite simple robot, but works sufficiently good.

It was tested on EURUSD and USDJPY pairs on M5, M15, M30, H1, H4 timeframes. Every tick data with variable spread and modeling quality of 99.9 percent were used for testing.


Parameters

Trading rules variables

  • MA1_Fast_Period - fast moving average period
  • MA2_Slow_Period - slow moving average period
  • EMA_Period - exponential moving average used for trend confirmation

Position sizing settings

  • Lots - enter fixed lot size, but if trigger IsSizingOn = true, Lots variable will be ignored
  • IsSizingOn - if true, lot size is received automatically depending on chosen risk and stop loss value
  • Risk - risk per trade (in percentage)
  • MaxPositionsAllowed - maximum positions allowed to be generated on the platform from different charts. So, total theoretical risk can be calculated: (Risk) * (MaxPositionsAllowed)

TP, SL and TS settings

  • StopLoss - enter static stop loss value if you do not use ATR settings
  • TakeProfit - enter static take profit value if you do not use ATR settings
  • TrailingStop - enter static trailing stop value if you do not use ATR settings
  • Use_ATR_Settings - if true, the robot uses ATR settings, if false, it uses static stop loss, take profit and trailing stop values
  • ATR_PERIOD - ATR period
  • K_SL - multiplier for stop loss value (1 unit is 1 ATR value)
  • K_TP - multiplier for take profit value (1 unit is 1 ATR value)
  • K_TS - multiplier for trailing stop value (1 unit is 1 ATR value)

EA general settings

  • MagicNumber - use different number for each pair and TF if you are working on one trade platform
  • MaxSpread - max spread value. It is better below 3 pips (30 points)
  • Slippage - use 3-5 points for Forex pairs
  • OnJournaling - if true, add EA comments in the Journal tab

Time settings

  • OnTime_Filter - if true, enable the time filter
  • Open_Monday_Hour – enter start hour on Monday to allow the EA to generate signals (integer value 0-23)
  • Close_Friday_Hour – enter end hour on Friday, after which signals are banned (integer value 0-23)
  • GMT_Offset – enter your broker's GMT offset (integer value from -12 to 12)


No reviews
Version 1.1 - 2018.07.10
1. General code was optimized and user parameters window was more friendly structured.
2. Sizing option was added. If it is checked, the lot size is automatically calculated depending on chosen risk and stop loss value.
3. Time filter option was added. You can define the start hour in Monday and the end hour in Friday for the robot to generate the signals.

New parameters added:

Position Sizing Settings

• IsSizingOn If 'true', lot size is received automatically depending on chosen risk and stop loss value
• Risk Risk per trade (in percentage)
• MaxPositionsAllowed Maximum positions allowed to be generated on the platform. So, total theoretical risk can be calculated: (Risk) * (MaxPositionsAllowed)

EA General Settings

• OnJournaling Add EA comments in the Journal Tab

Time Settings

• OnTime_Filter If 'true', the time filter is enabled
• Open_Monday_Hour Start hour on Monday allowing EA to generate signals (integer value 0-23)
• Close_Friday_Hour End hour on Friday, after which signals are banned (integer value 0-23)
• GMT_Offset GMT offset (integer value from -12 to 12)