About the Traffic Light Trend Moving Average Expert Advisor
The Traffic Light trend strategy Metatrader 4 Forex Robot is an algorithmic trading software that shows a trend system built on moving averages with colors as seen in traffic lights.
The main purpose of coding this EA is to examine the trading robot on historical data and select functional parameters.
A buy entry is initiated based on a set of printed logic that shows that the moving averages are aligned in a top-to-bottom fashion, i.e., Green – Yellow – Red.
A sell is based on the printed logic that follows the moving averages, getting positioned in the reverse order, i.e., Red – Yellow – Green.
The moving averages are represented as red (120 SMA period), yellow (55 SMA period), green (5 EMA period), dotted blue (24 EMA period), and dotted brown (24 EMA period).
Free Download
Download the “traffic_light_strategy.mq4” MT4 robot
Key Features
Five-Color MA Alignment
The EA monitors five moving averages (red = slow, yellow = mid, green = fast, plus blue-dotted and brown-dotted as trend bounds) and looks for precise colored order before entering trades.
Clear Buy/Sell Signals
Buy orders trigger only when green → yellow → red descending alignment occurs above the trend corridor. Sell orders fire on reverse ordering below it—minimizing ambiguous entries.
Optional Entry Modes
Choose to enter trades on the current candle when alignment completes, or delay entry until the next bar opens for confirmation.
Custom Stop Loss & Take Profit
Traders can define fixed SL/TP levels or let the EA calculate them based on MA spacing or ATR volatility for dynamic risk control.
Visual Trend Corridor
The blue-dotted and brown-dotted MAs create a visible channel representing the prevailing trend range, which helps filter out sideways market behavior.
Strategy Tester Report
Find below the Traffic Light trend strategy forex robot strategy tester report for the GBP/USD forex pair on the 1-Hour chart.
Overall Performance
The EA made a total profit of $1478.00 from a total of 91 trades.
The largest winning trade generated $237.72 in profits, while the largest losing trade generated a loss of $123.78.
Statistics:
Bars in test: 5262 ticks modelled
Initial deposit: $10000.00
Total net profit: $1478.00
Total trades: 91
Largest profit trade: $237.72
Largest loss trade: -$123.78
Consecutive wins: 2
Consecutive losses: 3
How the EA Works
- Continuously monitors MA alignment across five colored lines.
- Detects clean color sequence (green-yellow-red for buy; reverse for sell).
- Checks whether price sits outside the corridor (blue-dotted & brown-dotted MAs).
- Optionally waits for the next candle to confirm before entering.
- Applies stop loss and take profit per user rules or dynamic targets.
Download Now
Download the “traffic_light_strategy.ex4” Metatrader 4 robot
Parameters & Settings
- MA Red Period (slow MA)
- MA Yellow Period (mid MA)
- MA Green Period (fast MA)
- MA Blue-Dotted & Brown-Dotted Periods (trend corridor)
- Entry Mode (current candle vs next candle)
- Stop Loss / Take Profit (fixed or dynamic)
- Magic Number
- Slippage Limit
Recommended Trading Setup
- Use liquid currency pairs like EUR/USD, GBP/USD, USD/JPY for best spread conditions.
- Test on H1 or H4 timeframes for clearer trend alignment.
- Start with demo accounts to validate default settings and performance.
- Use conservative risk per trade (e.g., 1% of balance or fixed lot sizing).
- Avoid low-volatility or choppy market conditions where MA alignment is rare or deceptive.
FAQ
How many moving averages are used?
The EA uses five distinct MAs, each serving a role—from fast (green) to slow (red), and two additional dotted lines to form a trend corridor.
What defines a valid trade signal?
A buy is valid when green > yellow > red above the corridor lines. A sell triggers when red > yellow > green below the corridor.
Is the entry immediate or delayed?
You can choose: the EA can enter on the same candle when the alignment appears or wait until the next candle opens to confirm stability.
Can I customize stop loss and take profit?
Yes—fixed values can be specified, or you can enable dynamic calculation based on MA spacing or other volatility metrics.
Which timeframe works best?
H1 and H4 are often most effective due to clearer trend phases. Lower timeframes may produce noise-driven signals.
Summary
The Traffic Light Trend Moving Average EA introduces a systematic, visually intuitive approach to automated trading.
By leveraging colored MA alignments and a trend corridor, it ensures entries align with genuine directional momentum.
It’s simple to install, free to download, and packed with customization options to suit both cautious and more aggressive traders.
Begin with demo testing, refine your parameters, and let the EA manage entries with traffic-light clarity and disciplined risk control.

