Cumulative Delta Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Real delta needs bid and ask volume that forex brokers never publish. The cumulative delta indicator estimates it from where each close sat inside its bar, then adds the results up. What matters most is the anchor: four reset modes decide whether you read a session, a week or the whole chart.

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 Separate window (levels 0)
Plots 6: CVD rising, CVD falling, CVD, CVD signal, Delta buy cross, Delta sell cross
Alerts popup, push notification, email, sound
Inputs 23

What the Cumulative Delta Indicator draws on the chart

Four plots and two marks, in a pane.

`CVD rising` fills turquoise at width 3.

`CVD falling` fills crimson instead.

`CVD` traces white smoke over both.

`CVD signal` traces gold at width 2.

Cross marks use arrow 233 and arrow 234.

  • CVD rising: histogram, turquoise, width 3
  • CVD falling: histogram, crimson, width 3
  • CVD: line, white smoke, width 1
  • CVD signal: line, gold, width 2
  • Delta buy cross: arrow, spring green, width 2, arrow code 233
  • Delta sell cross: arrow, orange red, width 2, arrow code 234
cumulative delta indicator: The running total, its average and a gated cross, EURUSD H1.
The running total, its average and a gated cross, EURUSD H1.

How the Cumulative Delta Indicator calculates its values

Splitting a bar

Close placement does it. A close at the high gives the bar’s whole volume to buying. A close at the low gives it to selling. Anything between splits the two.

The anchor

`InpResetMode` `1` anchors daily by default. Zero runs on without a reset, two anchors weekly, and three keeps a rolling `InpRollBars` `288` window.

Signal and gate

`InpSignalPeriod` `21` averages the running total. A crossing counts only once the gap clears `InpMinCrossSepAmpFrac` `0.010` of the swing. `InpMinBarsApart` `6` spaces the rest.

How to work with it

The running total matters more than any single bar.

Colour shows whether that total is climbing or falling.

A rising total with flat price is the classic divergence.

The anchor decides what the total is measuring.

Continuous mode drifts and stops responding.

The panel prints the current figures as text.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

A gated crossing of the running total and its average is what reports. `EnableAlerts` sits above every message and starts on with `EnablePopup`. Push, mail and audio all wait, and the amplitude gate means far fewer messages than raw crossings would produce.

Every Cumulative Delta Indicator input

Core settings

Setting What it does Default
InpResetMode Accumulation: 0=continuous 1=daily 2=weekly 3=rolling window. Anchor the total: on, daily, weekly or rolling, `1`. 1
InpRollBars Rolling window length in bars (ResetMode 3 only). Window length in rolling mode, `288`. 288
InpUseRealVolume Use real volume when the broker supplies it (forex rarely does). Take broker volume where it exists, `false`. off
InpSignalPeriod EMA period of the CVD used as the signal line. Bars averaging the running total, `21`. 21
InpMinCrossSepAmpFrac Amplitude gate: CVD-to-signal gap at the cross, as a fraction of the visible CVD span. Gap a crossing must clear, `0.010`. 0.010
InpMinBarsApart Minimum bars between two signals on the same side. Bars held between same-side marks, `6`. 6
InpMaxObjects Hard cap on chart objects this indicator may create. Cap on chart objects, `256`. 256
InpX Panel X offset (px). 12
InpY Panel Y offset (px) on the MAIN chart window (Pattern 15b). 120

Display settings

Setting What it does Default
InpArrowOffset Arrow offset from the cross, as a share of the visible CVD span. Mark offset as a share of the swing, `0.05`. 0.05
InpShowPanel Show the CVD readout panel. Show the readout, `true`. on
InpCorner Panel corner (0=UL 1=UR 2=LL 3=LR). 0
InpFontSize Panel font size. 9
InpFont Panel font. Consolas
InpPanelBg Panel background colour. RGB 8,22,26
InpBorderColor Panel border colour. teal
InpTextColor Panel text colour. gainsboro

Alert settings

Setting What it does Default
EnableAlerts Master alert switch. Whether a gated crossing reports, `true`. on
EnablePopup Terminal popup alert. on
EnablePushNotify Push notification to the phone. off
EnableEmail Email alert. off
EnableSound Play a sound file. off
SoundFile Sound file name. alert.wav
cumulative delta indicator: Inputs panel, InpResetMode above the gating settings.
Inputs panel, InpResetMode above the gating settings.

Where the defaults suit

The default anchor resets daily, so a session needs several bars in it. EURUSD H1 is the reference chart, where the total builds a readable shape by afternoon. Drop to M5 and the rolling mode suits better. On daily bars the daily anchor is meaningless.

Where the logic runs out

Close placement is an estimate, not an order record.

Tick volume counts price changes, not contracts.

Continuous mode grows until new bars barely register.

A divergence can persist far longer than it is useful.

Copy the compiled Cumulative Delta 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.

Download the Cumulative Delta Indicator for MT4 and MT5

The zip holds the compiled Cumulative Delta 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

What does InpResetMode 1 anchor to?

Each new day. The running total starts again at every session, which makes it a reading of today rather than of the whole chart. Mode zero never resets, and after a few thousand bars a new one barely moves it.

Is this real bid and ask delta?

No, and it cannot be on spot forex. Brokers do not publish which side each trade hit, so the split comes from where the close sat inside the bar. That is a reasonable estimate, not a record of what traded.

Why does InpMinCrossSepAmpFrac gate the crossings?

Because the total and its average run together for long stretches and cross repeatedly with nothing behind it. Requiring the gap to reach one percent of the visible swing removes most of those.

When is InpRollBars 288 the right mode?

On a fast chart where a daily anchor resets too often to build a shape. Two hundred and eighty-eight bars is a day of M5, so the rolling window gives a steady day-long reading that never jumps at midnight.

Are results guaranteed?

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

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