This automated trading system utilizes a straightforward MACD strategy that incorporates various technical indicators. Its primary purpose is to evaluate how effectively this strategy operates within actual trading conditions.
Main Features
The system implements a standard MACD crossover strategy: it triggers a buy when the main line crosses above the signal line below zero and a sell when it crosses below the signal line above zero, with the following parameters:
• Fast EMA: 12
• Slow EMA: 26
• Signal line:It features a 200-period moving average for trend filtering. When the price is above this moving average, the system will only execute buy orders; conversely, if the price is below, only sell orders will be executed.
The strategy also integrates price action analysis: a touch on a support level is required for a buy trade, while for a sell trade, the price must exceed the resistance level. This is facilitated through a custom Box.mq4 indicator that identifies support and resistance levels, which can be subjective.
Risk management is critical in this strategy. The Stop Loss (SL) is always positioned above the moving average for sell trades and below for buy trades, calculated based on a user-defined parameter called SLPointDistanceFromMA. The Take Profit (TP) is set at 1.5 times the SL distance.
It's worth noting that MACD and support/resistance signals do not need to occur simultaneously. The SignalValidity input determines how many candles these signals remain valid after they appear.
Input Parameters
| Parameter | Description |
|---|---|
| SignalValidity (int) | Number of candles a signal remains valid after appearing (default: 7) |
| Lotsize (double) | Trade volume for each order |
| SLPointDistanceFromMA (int) | Distance (in points) between the moving average and the stop loss level |


