Dark Inversion Indicator: ATR-Sized Reversal Candles

Written by Dominic Walsh · Published · Last updated

The dark inversion indicator looks for one specific candle. Price has closed lower three bars running, and then a single bullish candle arrives with a body larger than 0.6 of the current ATR. That combination puts a lime arrow under the bar. The bearish mirror puts a red arrow above it.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 2: Inversion BUY, Inversion SELL
Alerts popup
Inputs 5

What the Dark Inversion Indicator draws on the chart

Inversion BUY places a lime arrow below the candle that flipped a run of lower closes.

Inversion SELL places a red arrow above the candle that flipped a run of higher closes.

Nothing else appears, so the tool overlays cleanly on whatever else you have running.

`InpArrowOffsetPts` at `8.0` sets the gap between arrow and candle in points.

  • Inversion BUY: arrow, lime, width 2, arrow code 233
  • Inversion SELL: arrow, red, width 2, arrow code 234
Dark inversion indicator on EURUSD H1 marking ATR-sized reversal candles
Dark inversion indicator on EURUSD H1 marking ATR-sized reversal candles

How the Dark Inversion Indicator calculates its values

Sizing the candle against ATR

body takes the absolute difference between close and open. min_body takes iATR at `InpATRPeriod` `14` multiplied by `InpBodyATRMult` `0.6`. A candle qualifies only when its body clears that threshold. Scaling by ATR keeps the test meaningful as volatility changes.

Confirming the run it reverses

prior_down starts true and fails the moment any of the last `InpTrendLookback` closes rose. The default of `3` therefore demands three consecutive lower closes ahead of the signal bar. prior_up mirrors that for the sell case. Both checks read closes only, never highs and lows.

Placing the mark

A bullish candle with a qualifying body after a confirmed down run writes low minus the offset into BufBuy. A bearish candle after an up run writes high plus the offset into BufSell. Warmup covers `InpATRPeriod` plus `InpTrendLookback` plus one bar, so nothing draws before ATR has settled.

How to read the signals

One arrow marks one candle. There is no trend filter and no target.

A larger `InpBodyATRMult` gives fewer marks on visibly bigger candles.

Three lower closes is a short run, so expect marks inside ranges as well as at turns.

Check the candle yourself. The code measures the body, not the context around it.

Alert channels in this build: popup, one message per closed bar.

`InpEnableAlerts` ships on and drives a terminal popup. There is no push, email or sound channel in this build, so the message stays on the desktop. The guard allows one alert per closed bar.

Every Dark Inversion Indicator input

Core settings

Setting What it does Default
InpATRPeriod ATR period. ATR length behind the body threshold, default `14`. 14
InpBodyATRMult Body size threshold in ATR units. Body size in ATR units, default `0.6`. Raise it toward 1.0 for rarer, larger candles. 0.6
InpTrendLookback Bars to confirm prior trend. Consecutive closes that define the prior run, default `3`. Raise it to demand a longer slide before the flip counts. 3

Display settings

Setting What it does Default
InpArrowOffsetPts Arrow offset in points. Arrow distance from the candle in points, default `8.0`. 8.0

Alert settings

Setting What it does Default
InpEnableAlerts Enable bar-close alert. Bar-close popup, default `true`. on
Dark inversion indicator inputs: InpATRPeriod, InpBodyATRMult, InpTrendLookback
Dark inversion indicator inputs: InpATRPeriod, InpBodyATRMult, InpTrendLookback

Settings that fit your chart

A single-candle test travels well, because ATR rescales it for each instrument. EURUSD H1 is the reference chart. Down on M1 and M5 the body test catches noise as often as anything else, since three bars there means very little. H1 and H4 give runs worth reversing, and on the daily chart each mark becomes a genuine event.

When the Dark Inversion Indicator fails

Three consecutive closes is a weak definition of a trend, so plenty of marks land mid-range.

A large body can come from a news spike that unwinds on the very next bar.

This build has no memory of earlier signals, so it will mark the same pattern repeatedly in a choppy stretch.

Copy the compiled Dark Inversion Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Dark Inversion Indicator: Dark pool on Wikipedia, Percentage Volume Oscillator Pvo at StockCharts ChartSchool.

Download the Dark Inversion Indicator for MT4 and MT5

The zip holds the compiled Dark Inversion Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

How does InpBodyATRMult filter out small candles?

The candle body must clear 0.6 of the current ATR. On EURUSD H1 with ATR near 12 pips, that works out around a 7 pip body. Raise the multiple to 1.0 and you will see far fewer marks, every one of them on a visibly larger candle.

How long a run does InpTrendLookback demand?

Three closes by default. The code walks back three bars and fails the check the moment one of them closed higher for a buy case. Raise it to 5 when you want the reversal to follow a longer slide, at the cost of a much thinner signal count.

Why does InpATRPeriod scale the body test?

Because a 10 pip body means one thing on gold and another on EURUSD, and something different again in a quiet Asian session. `InpATRPeriod` at `14` rescales the threshold to current conditions, so a single setting travels between instruments.

Where does the Inversion BUY arrow sit?

Below the qualifying candle, at low minus `InpArrowOffsetPts` points. The default of `8.0` keeps it clear of the wick without floating away. Increase it on charts with tall candles so the mark does not overlap the bar it belongs to.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Dark Inversion Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Also, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment