Cumulative Delta MT4

The indicator analyzes the volume scale and splits it into two components - seller volumes and buyer volumes, and also calculates the delta and cumulative delta.

The indicator does not flicker or redraw, its calculation and plotting are performed fairly quickly, while using the data from the smaller (relative to the current) periods.

Full recalculation of data is performed once per minute, when a new candle opens on the M1 timeframe, or in case of a user activity, namely, when scrolling the chart deeper into the history, when changing the time scale of the chart or when changing the current timeframe.

By default, the initial reference point is the very first candle from the left border of the chart window. The reference point can be changed using the BarsLimit input variable.

In case the data on any of the periods required in calculations is missing, the indicator generates a corresponding message.

The indicator operation modes can be switched using the Mode input variable:

Buy - display only the buyer volumes.

Sell - display only the seller volumes.

BuySell - display only the buyer and seller volumes in two separate scales.

Delta - the mode of difference (delta) between the buyer volumes and seller volumes.

CumDelta - cumulative delta mode.

CumDeltaDaily - cumulative delta mode with zeroing the balance at the beginning of each day.

CumDeltaWeekly - cumulative delta mode with zeroing the balance at the beginning of each week.

Fixed calculation of cumulative volume period in the DemandAndSupply mode for financial symbols having an additional short trading day.

Version 1.3 - 2017.06.23

Added new DemandAndSupply mode, which is displayed as a demand and supply diagram with two lines.
The green line shows demand, the red line shows supply.
The mode can be additionally managed using the DsContrast input variable:
DsContrast = 0 - no candlestick coloring,
DsContrast > 1 - coloring candlesticks,
DsContrast < -1 - reverse coloring.

Version 1.2 - 2017.04.14

No significant changes have been made. The indicator code has been slightly optimized in order to reduce the number of excessive cyclic calculations and, as a consequence, to reduce the load on the terminal.

Version 1.1 - 2017.03.28

In the CumDelta, CumDeltaDaily and CumDeltaWeekly modes, a price line based on Close prices of candles is scaled and displayed in the indicator window, in parallel with the cumulative delta line.