TradingView
makit0
3 févr. 2020 07:50

Market Delta [Makit0] 

E-mini S&P 500 Futures (Mar 2020)CME

Description

MARKET DELTA INDICATOR v0.5 beta

Market Delta is suitable for daytrading on intraday timeframes, is a volume based indicator which allows to see the UP VOLUME vs the DOWN VOLUME, the DELTA (difference) and the CUMULATIVE DELTA (cumulative sum of difference) between them
This indicator is based on contracts volume (data avaiable), not in ask/bid volume (data not avaiable)

The up/down volume is calculated at each candle as follows:
- calculate the ticks of the range, top wick and bottom wick
- calculate the ticks up and ticks down to get the total ticks of the candle
- calculate the volume per tick as total volume divided by total ticks
- calculate the up and down volume as volume per tick multiplied by up ticks and down ticks
The delta is calculated as volume up minus volume down
The cumulative delta is a cumulative sum of delta and is resetted to 0 twice a day at the globex open and at the us cash open

By default the indicator plots the 'CANDLE MODE' which is useful for charting the cumulative volume to find out support and resistance zones where the volume is rejected or pass thru, as the volume moves so does the price, price always follows the volume, price goes away from where volume dries and price auctions comfortable where is plenty of volume, in a way PRICE FEEDS ON VOLUME
An indication about the plotting style in the volume, delta and cumulative delta modes: I can't use histogram as intended due a bug at autoresizing the scale in the candle mode, so the styles used are areabr and circles.

FEATURES
- Plot volume in one of four modes: Volume Up/Down, Delta, Cumulative Delta, Cumulative Delta as Candles
- Cumulative delta resetted twice a day (globex and cash open)
- Show a base line at 0

SETTINGS
- Mode: select one of the four volume output modes: Volume, Delta, Cumulative Delta and Candles. Candles by default
- Show zero line: show/hide the zero base line. False by default.

HOW TO SETTING UP THE INDICATOR:
BE AWARE, by default the indicator settings are configured for using the Cumulative Delta Candle Mode
- Candles Mode Settings: configured by default, mode candles and zero line off
- Volume, Delta, Cumulative Delta Mode Settings: select the mode you want and switch on/off the zero line

GOOD LUCK AND HAPPY TRADING
Commentaires
Wali303
script is not loading for indian market , please help , i don't know pine :(
ivan.szaks
Hi. I really like this indicator. Is it possible to have a version that does not reset to zero? I.e., for the Crypto markets, can you make it perpetually cumulative?
paoleks
changed to take into account gaps and be able to watch daily charts
(It turns out that you cannot insert square brackets here, so I inserted curly braces instead of square)

//@version=4
study("Volume_Delta",shorttitle='VD')

// volume & delta calculus
gapUp= open>close{1}?(open-close{1})/syminfo.mintick:0
gapDown= open<close{1}?(close{1}-open)/syminfo.mintick:0
candleRange = (high-low)/syminfo.mintick
candleTopWick = open>close?(high-open)/syminfo.mintick:(high-close)/syminfo.mintick
candleBottomWick = open>close?(close-low)/syminfo.mintick:(open-low)/syminfo.mintick
ticksUp = open>close?candleTopWick+candleBottomWick+gapUp:candleRange+gapUp
ticksDown = open>close?candleRange+gapDown:candleTopWick+candleBottomWick+gapDown
totalTicks = ticksUp+ticksDown
volByTick = totalTicks==0?0:volume/totalTicks
volUp = ticksUp*volByTick
volDown = ticksDown*volByTick
delta = volUp-volDown

cumDelta = 0.0
cumDelta := nz(cumDelta{1})+delta

// getting ohlc values to plot the cumulative delta candles.
o = cumDelta{1}
c = cumDelta
h = delta>=0 ? c : o
l = delta<=0 ? c : o

// plotting cumulative delta as candles. Two 'plotcandle' calls to set wickcolor/bordercolor 'dinamically' setting 'o' to 'na' when needed
plotcandle(o<=c?o:na, h, l, c, title='Cumulative Delta Green Candle', color = color.green,wickcolor=color.green,bordercolor=color.green)
plotcandle(o>=c?o:na, h, l, c, title='Cumulative Delta Red Candle', color = color.red,wickcolor=color.red,bordercolor=color.red)
nachoosx
@paoleks, these code dont charge, line 10 and 11 have problems.
adamsid
First of all, thank you for making this available to the community. Any chance you could set up Berlin time zone? Cheers!
sonvardy
Thanks for this, What's the difference between contracts volume and ask/bid volume?
sikhopitana
I love the Indicator the only thing different I wish for is if there was a setting to set our own reset time or make delta reset on all assets at 0:00 am gmt
Marleez
amazing indicator, is there a way to get this working on DAX ?
FaisalMahboobe3
Hi, thanks for creating and sharing this awesome indicator. The cumulative delta setting doesn't seem to work for me. The others plot very nicely. Can you please assist? Cheers.
Plus