Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Traffic Light Trend Strategy Expert Advisor - MetaTrader 4 Expert | MT4 EA Download - MetaTrader 4 Resources

author EAcpu | 5 reads | 0 comments |

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

A trend strategy based on moving averages, whose colors are like traffic lights. The purpose of writing an EA — to test strategies and choose working parameters based on history.

The strategy consists of one indicator - Moving Average with 5 different parameters:

A buy signal is formed when the moving averages are arranged in order from top to bottom: greenyellowred .

A sell signal is formed when the indicators are arranged in the reverse order: redyellowgreen .

Price is outside the corridor of the blue and brown dotted moving averages.

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

The EA opens signals according to the strategy. Take profit and stop loss are set in the initial parameters. Trading can be started in two modes: when all signals on the current candlestick match or when the next candlestick starts. Defined by the TimeOpenBar parameter. Trades are closed via Take Profit, Stop Loss or the intersection of the green and yellow moving averages. The trade closing at the intersection is defined by the CloseProfit parameter. The close of the green and yellow moving average crossover itself may occur on the current candlestick or at the beginning of the next candlestick, as defined by the TimeCloseBar parameter.

Setting the trigger of the event at the current candlestick or the next candlestick after the close greatly affects the quality of the test results and is determined by the acceptance of signals from the current position of the moving average or as if from historical facts. Before the candlestick closes, the moving average may be redrawn and produce false signals.

The "Trading Style" mode is defined by the StyleTrade parameter. Aggressive trade – open a new trade according to the strategy after the price enters the corridor between the blue and brown moving averages. Conservative trading – price enters the corridor between the red and yellow moving averages. Affects the number of positions opened by EA. All parameters are turned on by a number: 0 - parameter is off, 1 - parameter is on (can be any number except 0). This is done to facilitate EA testing in the strategy tester.

There are common MM volume calculations based on the chosen risk.

The video details the settings of Expert Advisor and its impact on test results.

Recommended time frame — H1. The EA shows the positive dynamics of the currency pairs GBPUSD, EURUSD, EURGBP in the current market in 2015.

Test on the GBPUSD currency pair:

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

Test the EURGBP currency pair:

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

With the CloseProfit parameter enabled, the Expert Advisor can trade without Stop Loss and/or Take Profit, in which case up to 70% of the trend movement can be obtained. Test the EURUSD currency pair without Take Profit and Stop Loss:

The Expert Advisor on Traffic Light trend strategy - expert for MetaTrader 4

Trailing stops for moving averages were added in version m00013. The default period is set to 85, which can be changed in the Trailing Stop settings block. The shorter the period, the faster the trade will reach breakeven, although a large portion of the trend will disappear. Vice versa, large values ​​can accommodate almost any trend.


Attachment download

📎 traffic_light_strategy.mq4 (8.14 KB)

📎 traffic_light_strategy.tpl (1.35 KB)

📎 traffic_light_strategy_m00013-capsule.mq4 (11.44 KB)

Source: MQL5 #13802

Verification code Refresh