Flat Detector - Range filter to avoid chop (MT4)
Flat Detector highlights ranging conditions and helps you skip low quality entries. It colors the background or prints blocks when volatility or slope drops below a threshold on MetaTrader 4. Trade the breaks out of flat and stand aside while the market is inside flat.
What it shows
- Flat zone when volatility or slope is under the chosen threshold.
- Trend zone when the metric recovers above the threshold.
- Optional alerts on enter flat, exit flat and first trend bar.
- Can be used as an EA filter or session map.
Trade ideas
- No trades in flat: only take setups when we are out of flat.
- Breakout after flat: trade the first clean impulse bar that closes outside the flat area.
- Pullback confirmation: if price pulls back into flat and returns out - rejoin the trend.
- Multi TF: avoid entries when higher TF is flat even if lower TF trends.
Inputs that matter
- Method: volatility based or slope based.
- Threshold level and lookback.
- Smoothing for the metric and minimum bars in flat.
- Alerts and visuals.
Suggested usage
- M5-M15: session filter and momentum timing.
- M30-H4: swing filter before breakouts.
- Daily+: regime map and plan building.
Installation (MT4)
- Open MetaTrader 4 - File - Open Data Folder.
- Copy
Flat_Detector.ex4
to MQL4/Indicators. - Restart MT4 or refresh Navigator and attach Flat Detector.
- Adjust inputs - OK.
FAQ
Does it repaint? No on closed bars.
Which symbols? Works on FX, indices, metals, crypto.
Use in EAs? Yes, via iCustom
.
Disclaimer: Always test on a demo first - risk management matters.