SuperTrend Indicator and Stop-and-Reverse EA for MT5
A TradingView-matching Wilder-ATR SuperTrend indicator embedded as a resource inside a self-contained auto-trading EA.
Timeframe, ATR period, multiplier, risk sizing, line-stop and trail, direction, trading hours and spread filter; 403 flips produced 403 entries with zero failed requests after a session-trade check.

- Indicator values match TradingView's SuperTrend
- Single self-contained .ex5 via embedded resource
- 403 flips = 403 entries, 0 failed requests in the tester
- Session-trade check prevents market-closed rejections
A compact but complete MetaTrader 5 package: a SuperTrend indicator computed with Wilder's ATR so it matches TradingView's values, and an Expert Advisor that trades every flip as a stop-and-reverse. The indicator is compiled into the EA with a resource directive, so a single .ex5 file is all a user installs.
Inputs cover the signal timeframe, ATR period and multiplier, fixed lot or risk-based sizing, a stop on the SuperTrend line with optional trailing, direction filter, trading hours and a maximum spread. The tester run on gold over eight months produced 403 flips and exactly 403 entries with no failed order requests, but only after adding a session check: the broker's gold session reopens one minute after the bar opens, and the first attempt returned market-closed errors on every Monday bar.
The headless tester harness and its port workaround were documented for reuse, and the rule that the main terminal is a real-money account meant the EA was deployed there but never attached by automation; attaching to live is my click.
Trading tool; shared as engineering work, not financial advice.
How it works
- Indicator computes Wilder ATR bands and the SuperTrend line
- EA reads the embedded indicator on each new bar
- Flip closes the open position and opens the opposite side
- Stops follow the line with optional trailing; hours and spread filters gate entries
- Tester harness verifies entry counts and request results
Software and automation are infrastructure, not financial advice. No performance guarantees. Every live system needs staged testing, risk limits, and owner approval.