Attributable VolumeA volume indicator which calculates "Attributable Volume”, the portion of volume which contributed to the direction in which the candle moved.
Attributable Volume is calculated as: Total volume excluding the "counter wick" volume.
Where for a green (up) candle, the "counter wick" volume is the top wick volume.
In theory, Attributable Volume should better represent the effort of directional thrust of each candle.
By default, this indicator displays “Attributable RVOL”, but can be set to:
Attributable RVOL
RVOL
Attributable Volume
Volume
Note: RVOL = Relative Volume, the current volume divided by the Volume moving average. RVOL can be used to identify major moves, and potential starts/ends to trends.
X-volume
Candle VolumeScript Based on Volume Based Coloured Bars by KivancOzbilgic
/////////////
This indicator turns the candle into a volume-weighted signal, When the price falls, the candle is red, and when the price rises, the candle is green. In addition, we each have two colors Happening:
Dark red: It is dark red when the downtrend trading volume is greater than 200% of its average price (default 20 days), which indicates that our price action is supported by strong bearish trading volume
Red: When the price drops and the trading volume is between 50% and 200% of its average (default 20 days), in this case, we can think that the trading volume is neither strong nor weak
Light red: When the price drops and VOLUME is less than 50% of its average price (default 20 days), the trading volume is weak and there is not much support for price movements
Dark green: When the price rises and the trading volume is greater than 200% of its average price (default 20 days), it indicates that our price movement is supported by a strong bullish trading volume
Green: When the price rises and the trading volume is between 50% and 200% of its average price (the default is 20 days), in this case, we can think that the trading volume is neither strong nor weak
Light green: When the price rises and the trading volume is less than 50% of its average price (default 20 days), the trading volume is weak and does not support the price trend well
Default Low Volume is 50% (0.5) and High 200% (2), but if those values don't suit you, you can change them according to your trading personality
//////////////////////////
Esse é um indicador que colore a candlera de acordo com o volume baseado na média, quando o volume está acima da média a candlera fica verde, e quando está abaixo, a candlera fica vermelha, e as cores das candleras funcionam dessa forma :
Vermelho escuro: fica vermelho escuro quando o preço cai e o volume de negociação é superior a 200% do preço médio (padrão 20 dias), o que indica que nossa ação de preço é suportada por um forte volume de negociação de baixa
Vermelho: quando o preço cai e o volume de negociação está entre 50% e 200% de sua média (padrão de 20 dias), nesse caso, podemos pensar que o volume de negociação não é forte nem fraco
Vermelho claro: quando o preço cai e VOLUME é inferior a 50% do preço médio (padrão 20 dias), o volume de negociação é fraco e não há muito suporte para movimentos de preço
Verde escuro: quando o preço aumenta e o volume de negociação é superior a 200% do preço médio (padrão 20 dias), isso indica que nosso movimento de preço é suportado por um forte volume de negociação de alta
Verde: quando o preço aumenta e o volume de negociação está entre 50% e 200% do preço médio (o padrão é 20 dias), nesse caso, podemos pensar que o volume de negociação não é forte nem fraco
Verde claro: quando o preço aumenta e o volume de negociação é inferior a 50% do preço médio (padrão 20 dias), o volume de negociação é fraco e não suporta bem a tendência de preço
O volume baixo padrão é 50% (0,5) e alto 200% (2), mas se esses valores não forem adequados para você, você poderá alterá-los de acordo com sua personalidade de trading
Volume, Simple Relative Volume HighlightThis script plots volume bars and highlight bars that have an unusual activity, compare to the average (Standard: Simple Moving Average, 50 periods).
The script is useful for checking daily volume levels on equities. Where there is high volume, there is likely volatility, wich is good for day trading and swing trading entries.
Rolling Relative VolumeThis script sums the volume for the selected period and compares it to the selected period before that. It works on a rolling basis, so it is suitable for 24/7 markets such as crypto. That is the main difference between this and the regular RVOL indicator. Of course lower timeframes can also be selected for comparing changes in volume, but you should be aware how the times when markets are closed affect the calculation. For example, if used on stocks, the indicator will use the data that is available, meaning that the amount of data needed to calculate daily cumulative volume can be stretched out over a few days. If the stock session is 8 hours long, that comes out to 3 days.
There are 2 windows of reference when summing the volume:
1) The Recent volume window -> sums the volume between the current candle and the start of the window
2) The previous volume window -> sums the volume from the start of the current window until the start of the previous window
An example follows at the end :)
How to set up:
1) In settings, select the Timeframe; weekly, daily and hourly (W,D,H) are supported.
2) Choose the multiplier of the recent timeframe (for example 4 for cumulative volume over the last 4h)
3) Choose the multiplier of the previous timeframe (for example 8, if you want cumulative volume of the 8h before the start of the recent window)
Example:
Settings:
Timeframe: D
Recent volume multiplier: 3
Previous volume multiplier: 1
The chart set to 1h timeframe
This will calculate the cumulative volume for the past 24h, starting at the recent candle. Then it will calculate the cumulative volume for 72 hours before the start of the recent (24h) window. So in total it will need 24 + 72 = 96 hours of data to calculate.
After that it will compare the volume of the recent window with the average of the previous window. If values are above 1 the volume is increasing, if below 1 it is decreasing.
Why is this useful?
It's easy to spot changes in the volume and see if the volume is increasing and by how much, compared to previous days. Of course volume also drives liquidity. If volume is picking up, that could be the start of a bigger move.
WARNING!!!
Use on very low timeframes (1m, 3m) with big lookback periods (W) can break the script or make it execute very slowly due to the nature of the indicator.
Because this works on bar data it's possible that changing timeframes will change the calculation slightly. Generally, lower timeframes produce more accurate results, but take longer to calculate. The selected timeframe for the indicator should always be higher than the timeframe of the chart, otherwise the calculations won't make sense.
Leave a comment or send a DM for any improvements, bugs or ideas for automation / algo trading.
Volume Weighted Exponential Moving AverageYou might have heard that simple moving average barks twice, then you will also notice that volume weighted moving average is even more horrible.
Thanks to Trading View all I had to do was to replace SMA function with EMA.
VWEMA can be used as an adaptive moving average or even an alternative to VWAP.
1337 Volume - V2This volume script uses a Z-Score based filter to identify statistically significant high and low volume conditions.
It also includes a variation of LazyBear's obv_oscillator to map volume flow.
Regular volume will appear either lime or red.
Irregularly high volume will appear bright lime / bright red.
Irregularly low volume will appear white.
It comes with tested pre-defined thresholds and lookback lengths, but feel free to play with the settings on your own.
Enjoy!
Volume BTC/USDVolume of all exchange BTC/USD in $ or in quantity
Exchange Used:
BITSTAMP:BTCUSD
COINBASE:BTCUSD
BITFINEX:BTCUSD
GEMINI:BTCUSD
BITBAY:BTCUSD
BITTREX:BTCUSD
OKCOIN:BTCUSD
CEXIO:BTCUSD
KRAKEN:XBTUSD
24h volume by 100eyesIntroducing the 24h volume indicator on Tradingview!
DM me (Trading-Guru) here on Tradingview to get access to this indicator.
100eyes asked me to create a new Tradingview indicator that estimates the 24h volume of a pair. Works for all BTC/USDT/USD/ETH crypto pairs. You can choose to display the 24h volume in BTC or USD(T).
This indicator allows you to:
Check the 24h volume of a pair without having to check the website of the exchange
Quickly compare 24h volumes across pairs, e.g. ADABTC to ADAUSDT
Quickly compare 24h volumes of pairs across different exchanges
Volume is an important factor in crypto trading to estimate liquidity. Use this indicator to adjust your position size according to the volume of a pair.
Even on the website of an exchange, it's difficult to compare volume since for example volumes of USDT pairs are expressed in USDT, and volumes of BTC pairs are expressed in BTC. This indicator solves that problem by expressing everything in the same currency, and also directly on Tradingview!
F.A.Q.
Q: How do I get access to the indicator?
A: DM Trading-Guru on Tradingview.
Q: Why are there different values for different timeframes?
A: That is due to Tradingview limitations. The smaller the timeframe, the more accurate the displayed value. The timeframe you're looking at equals the maximum amount of lag.
Q: I'm on the Tradingview mobile app, why is the value is not displayed next to the indicator's name?
A: Click somewhere inside the chart. Then the indicator value will appear.
Relative Volume Strength IndexRVSI is an alternative volume-based indicator that measures the rate of change of average OBV.
How to read a chart using it?
First signal to buy is when you see RVSI is close to green oversold levels.
Once RVSI passes above it's orange EMA, that would be the second alert of accumulation.
Be always cautious when it reaches 50 level as a random statistical correction can be expected because of "market noises".
You know it's a serious uptrend when it reaches above 75 and fluctuates there, grading behind EMA.
The best signal to sell would be a situation where you see RVSI passing below it's EMA when the whole thing is close to Red overbought level
It looks simple, but it's powerful!
I'd use RVSI in combination with price-based indicators.
RedK_Supply/Demand Volume Viewer v1Background
============
VolumeViewer is a volume indicator, that offers a simple way to estimate the movement and balance (or lack of) of supply & demand volume based on the shape of the price bar. i put this together few years ago and i have a version of this published for another platform under different names (Directional Volume, BetterVolume) in case you come across them
what is V.Viewer
=====================
The idea here is to find a "simple proxy" for estimating the demand or supply portions of a volume bar - these 2 forces have the potential to affect the current price trend so we want an easy way to track them - or to understand if a stock is in accumulation or distribution - we want to do this without having access to Level II or bid/ask data, and without having to get into the complexity of exploring the lower timeframe price & volume data
- to achieve that, we depend on a simple assumption, that the volume associated with an up move is "demand" and the volume associated with a down move is "Supply". so we basically extrapolate these supply and demand values based on how the bar looks like - a full "green" price bar / candle will be considered 100% demand, and a full "red" price bar will be considered 100% supply - a bar that opens and closes at the same level will be 50/50 split between supply & demand.
- you may say this is a "too simple" of an assumption to make, but believe me, it works :) at least at the basic scenario we need here: i'm just exploring the volume movement and finding key levels - and it provides a good improvement compared to the classic way we see volume on a chart - which is still available here in VolumeViewer.
in all cases, i consider this to be work in progress, so i'd welcome any ideas to improve (without getting too complicated) - there's already a host of great volume-based indicators that will do the multi timeframe drill down, but that's not my scope here.
Technical Jargon & calculation
===========================
1. first we calculate a score % for the volume portion that is considered demand based on the bar shape
skip this part if it sounds too technical => if you're into coding indicators, you would probably know there are couple of different concepts for that algorithm - for example, the one used in Balance Of Power formula - which i'm a big fan of - but the one i use here is different. (how?) this is my own, ant it simply applies double weight for the "wick" parts of a price bar compared to the "body of the bar" -- i did some side-by-side comparison in past and decided this one works better. you can change it in the code if you like
2. after calculating the Bull vs Bears portion of volume, we take a moving average of both for the length you set, to come up with what we consider to be the Demand vs Supply - as usual, i use a weighted moving average (WMA) here.
3. the balance or net volume between these 2 lines is calculated, then we apply a final smoothing and that's the main plot we will get
4. being a very visual person, i did my best to build up the visuals in the correct order - then also to ensure the "study title" bar is properly organized and is simple and useful (Full Volume, Supply, Demand, Net Volume).
- i wish there was a way in Pine to hide a value that i still need to visually plot but don't want it showing its value on the study title bar, but couldn't find it. so the last plot value is repeated twice.
How to use
===========
- V.Viewer is set up to show the simplified view by default for simplicity. so when you first add it to a chart, you will get only the supply vs demand view you can see in the middle pane in the above chart
- Optional / detailed mode: go into the settings, and expose all other plots, you will be able to add the classic volume histogram, and the Supply / Demand lines - note these 2 lines will be overlay-ed on top of each other - this provides an easy way to see who is in control - especially if you change the display of these 2 lines into "area" style. This is what is showing in the lower pane in the above chart.
** Exploring Key Price Levels
- the premise is, at spots where there's big lack of balance, that's where to expect to find key price levels (support / resistance) and these price levels will come into play in future so can be used to set entry / exit targets for our trades - see the example in the AAPL chart where you can easily locate these "balance or reversal levels" using the tops/bottoms/zero-crossings from the Net Volume line
** Use for longer-term Price Analysis
- we can also use this simple indicator to gain more insights (at a high level) of the price in terms of accumulation vs distribution and if the sellers or buyers are in control - for example, in the above AAPL chart, V.Viewer tells us that buyers have been in control since October 19 - even during the recent drop, demand continued to be in play - compare that to DIS chart below for the same period, where it shows that the market was dumping DIS thru the weakness. DIS was bleeding red most of the time
Final thoughts
=============
- V.Viewer is an attempt to enhance the way we see and use Volume by leveraging the shape of the price bar to estimate volume supply & demand - and the Net between the 2
- it will work for stocks and other instruments as long as there's volume data
- note that V.Viewer does not track trend. each bar is taken in isolation of prior bars - the price may be going down and V.Viewer is showing supply going up (absorption scenario?) - so i suggest you do not use it to make decisions without consulting other trend / momentum indicators - of course this is a possible improvement idea, or can be implemented in another indicator, add in trend somehow, or maybe think of making this a +100 / -100 Oscillator .. feel free to play with these thoughts
- all thoughts welcome - if this is useful to you in your trading, please share with other trades here to learn from each other
- the code is commented - please feel free to use it as you like, or build things on top of it - but please continue to credit the author of this code :)
good luck!
-
Positive Volume Index + Negative Volume IndexThis is my version of plotting the classic Positive Volume Index and Negative Volume Index. They can be wildly different sometimes and not very helpful with entry and exit points but I hope this helps clearly identify buy and sell signals. Buy when the indicator is green and sell when it is red
This was a special request so let me know when you want more scripts from me!
VolHMA [sluggishmoney]Currently published volume scripts typically plot volume as a positive value. This one is different.
---WHAT IS IT---
If the close is greater than the open, the volume is considered positive, and if the close is less than the open, the volume is made negative. I have taken the HMA (Hull Moving Average) of this positive or negative volume with a default length of 100, and have plotted it as a histogram that is green if positive, and red if negative. The signal line is an SMA of this volume HMA with a default length of 10. The purple background is a suggested holding period for a potential long position.
---HOW TO USE IT---
When the HMA100 crosses above 0, this is considered a buy signal. This means that the smoothed volume is starting to become bullish (but delayed due to length of moving averages). When the HMA100 crosses under the signal, this is considered a sell signal.
---WHICH MARKETS---
I wrote this script specifically for cryptocurrency markets. The indicator does best with continuous volume data that's typically found in crypto markets, although I can picture this working well in FOREX as well. A volatile and continuous market can provide volume data that best captures the magnitude and direction of a move.
Negative Volume Disparity IndicatorThe Negative Volume Disparity Indicator was created by Phillip C. Holt (Stocks & Commodities V. 14:6 (265-269)). This converts the classic Negative Volume indicator into Bollinger Bands and calculates the percentage of where the value lies within the Bollinger Bands. Buy when the nvdi rises above its signal line and sell when it falls below the signal line.
The OBVDI was a special request so I figured I would add this one as well. Let me know what other indicators you would like me to write scripts for!
On Balance Volume Disparity IndicatorThe On Balance Volume Disparity Indicator was created by Phillip C. Holt (Stocks & Commodities V. 14:6 (265-269)). This converts the classic OBV indicator into Bollinger Bands and calculates the percentage of where the value lies within the Bollinger Bands. Buy when the obvdi rises above its signal line and sell when it falls below the signal line.
This was a special request so let me know what other indicators you would like me to write scripts for!
Bitfinex BTC Open InterestBitfinex open interest, or bitcoin open interest chart, shows the amount of open positions currently on Bitfinex BTC / USD trading pairs. Usually when open interest reaches unusually high numbers we'll see an increased volatility in Bitcoin's price. The open interest chart could also be useful for determining the tops and bottoms for Bitcoin.
On Balance Volume ReflexThe On Balance Volume Reflex Indicator was developed by Fred Purifoy (Stocks & Commodities V 6:4 142-144) and it is similar in calculation to the On Balance Volume indicator but uses a lookback period for the change comparisons. Buy when the OVR is above the signal and sell when it falls below the signal.
I have included my On Balance Volume Modified Indicator to highlight the differences between both indicators.
Let me know if you would like to see me write scripts for more indicators!
NJVolumeNJVolume
1. Additional Volume x Price Value
2. Indicate Volume High in 20d,50d,100d & 200d
3. Purple Diamond indicate volume strong for short term
Relative Volume (RVOL)I have seen a few RVOL scripts floating around out there, but when creating alerts, the parameters have not been labeled clearly that makes it easy to say: "Alert me when RVOL crosses up my Treshold." Look no further than my retooled version that clearly separates the two data series by color and label. Enjoy!
Volume xSMA ModSimple Volume indicator. showing rounded ratio of Current volume and simple moving average as xSMA (read as times SMA).
Quick metric to understand the impact of volume in trends, etc.
Example:
if Vol = 50 and SMA = 5
xSMA = 50/5 = 10
Indicated as the Third Number in Volume label.
PIVOT (POC)By AndersonGPIVOT (POC) By AndersonG
DAILY...
The pivot point itself is simply the average of the high, low and closing prices from the previous trading day. On the subsequent day, trading above the pivot point is thought to indicate ongoing bullish sentiment, while trading below the pivot point indicates bearish sentiment.
Delta Volume Columns Pro [LucF]█ OVERVIEW
This indicator displays volume delta information calculated with intrabar inspection on historical bars, and feed updates when running in realtime. It is designed to run in a pane and can display either stacked buy/sell volume columns or a signal line which can be calculated and displayed in many different ways.
Five different models are offered to reveal different characteristics of the calculated volume delta information. Many options are offered to visualize the calculations, giving you much leeway in morphing the indicator's visuals to suit your needs. If you value delta volume information, I hope you will find the time required to master Delta Volume Columns Pro well worth the investment. I am confident that if you combine a proper understanding of the indicator's information with an intimate knowledge of the volume idiosyncrasies on the markets you trade, you can extract useful market intelligence using this tool.
█ WARNINGS
1. The indicator only works on markets where volume information is available,
Please validate that your symbol's feed carries volume information before asking me why the indicator doesn't plot values.
2. When you refresh your chart or re-execute the script on the chart, the indicator will repaint because elapsed realtime bars will then recalculate as historical bars.
3. Because the indicator uses different modes of calculation on historical and realtime bars, it's critical that you understand the differences between them. Details are provided further down.
4. Calculations using intrabar inspection on historical bars can only be done from some chart timeframes. See further down for a list of supported timeframes.
If the chart's timeframe is not supported, no historical volume delta will display.
█ CONCEPTS
Chart bars
Three different types of bars are used in charts:
1. Historical bars are bars that have already closed when the script executes on them.
2. The realtime bar is the current, incomplete bar where a script is running on an open market. There is only one active realtime bar on your chart at any given time.
The realtime bar is where alerts trigger.
3. Elapsed realtime bars are bars that were calculated when they were realtime bars but have since closed.
When a script re-executes on a chart because the browser tab is refreshed or some of its inputs are changed, elapsed realtime bars are recalculated as historical bars.
Why does this indicator use two modes of calculation?
Historical bars on TradingView charts contain OHLCV data only, which is insufficient to calculate volume delta on them with any level of precision. To mine more detailed information from those bars we look at intrabars , i.e., bars from a smaller timeframe (we call it the intrabar timeframe ) that are contained in one chart bar. If your chart Is running at 1D on a 24x7 market for example, most 1D chart bars will contain 24 underlying 1H bars in their dilation. On historical bars, this indicator looks at those intrabars to amass volume delta information. If the intrabar is up, its volume goes in the Buy bin, and inversely for the Sell bin. When price does not move on an intrabar, the polarity of the last known movement is used to determine in which bin its volume goes.
In realtime, we have access to price and volume change for each update of the chart. Because a 1D chart bar can be updated tens of thousands of times during the day, volume delta calculations on those updates is much more precise. This precision, however, comes at a price:
— The script must be running on the chart for it to keep calculating in realtime.
— If you refresh your chart you will lose all accumulated realtime calculations on elapsed realtime bars, and the realtime bar.
Elapsed realtime bars will recalculate as historical bars, i.e., using intrabar inspection, and the realtime bar's calculations will reset.
When the script recalculates elapsed realtime bars as historical bars, the values on those bars will change, which means the script repaints in those conditions.
— When the indicator first calculates on a chart containing an incomplete realtime bar, it will count ALL the existing volume on the bar as Buy or Sell volume,
depending on the polarity of the bar at that point. This will skew calculations for that first bar. Scripts have no access to the history of a realtime bar's previous updates,
and intrabar inspection cannot be used on realtime bars, so this is the only to go about this.
— Even if alerts only trigger upon confirmation of their conditions after the realtime bar closes, they are repainting alerts
because they would perhaps not have calculated the same way using intrabar inspection.
— On markets like stocks that often have different EOD and intraday feeds and volume information,
the volume's scale may not be the same for the realtime bar if your chart is at 1D, for example,
and the indicator is using an intraday timeframe to calculate on historical bars.
— Any chart timeframe can be used in realtime mode, but plots that include moving averages in their calculations may require many elapsed realtime bars before they can calculate.
You might prefer drastically reducing the periods of the moving averages, or using the volume columns mode, which displays instant values, instead of the line.
Volume Delta Balances
This indicator uses a variety of methods to evaluate five volume delta balances and derive other values from those balances. The five balances are:
1 — On Bar Balance : This is the only balance using instant values; it is simply the subtraction of the Sell volume from the Buy volume on the bar.
2 — Average Balance : Calculates a distinct EMA for both the Buy and Sell volumes, and subtracts the Sell EMA from the Buy EMA.
3 — Momentum Balance : Starts by calculating, separately for both Buy and Sell volumes, the difference between the same EMAs used in "Average Balance" and
an SMA of double the period used for the "Average Balance" EMAs. The difference for the Sell side is subtracted from the difference for the Buy side,
and an RSI of that value is calculated and brought over the −50/+50 scale.
4 — Relative Balance : The reference values used in the calculation are the Buy and Sell EMAs used in the "Average Balance".
From those, we calculate two intermediate values using how much the instant Buy and Sell volumes on the bar exceed their respective EMA — but with a twist.
If the bar's Buy volume does not exceed the EMA of Buy volume, a zero value is used. The same goes for the Sell volume with the EMA of Sell volume.
Once we have our two intermediate values for the Buy and Sell volumes exceeding their respective MA, we subtract them. The final "Relative Balance" value is an ALMA of that subtraction.
The rationale behind using zero values when the bar's Buy/Sell volume does not exceed its EMA is to only take into account the more significant volume.
If both instant volume values exceed their MA, then the difference between the two is the signal's value.
The signal is called "relative" because the intermediate values are the difference between the instant Buy/Sell volumes and their respective MA.
This balance flatlines when the bar's Buy/Sell volumes do not exceed their EMAs, which makes it useful to spot areas where trader interest dwindles, such as consolidations.
The smaller the period of the final value's ALMA, the more easily you will see the balance flatline. These flat zones should be considered no-trade zones.
5 — Percent Balance : This balance is the ALMA of the ratio of the "On Bar Balance" value, i.e., the volume delta balance on the bar (which can be positive or negative),
over the total volume for that bar.
From the balances and marker conditions, two more values are calculated:
1 — Marker Bias : It sums the up/down (+1/‒1) occurrences of the markers 1 to 4 over a period you define, so it ranges from −4 to +4, times the period.
Its calculation will depend on the modes used to calculate markers 3 and 4.
2 — Combined Balances : This is the sum of the bull/bear (+1/−1) states of each of the five balances, so it ranges from −5 to +5.
█ FEATURES
The indicator has two main modes of operation: Columns and Line .
Columns
• In Columns mode you can display stacked Buy/Sell volume columns.
• The buy section always appears above the centerline, the sell section below.
• The top and bottom sections can be colored independently using eight different methods.
• The EMAs of the Buy/Sell values can be displayed (these are the same EMAs used to calculate the "Average Balance").
Line
• Displays one of seven signals: the five balances or one of two complementary values, i.e., the "Marker Bias" or the "Combined Balances".
• You can color the line and its fill using independent calculation modes to pack more information in the display.
You can thus appraise the state of 3 different values using the line itself, its color and the color of its fill.
• A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Default settings
Using the indicator's default settings, this is the information displayed:
• The line is calculated on the "Average Balance".
• The line's color is determined by the bull/bear state of the "Percent Balance".
• The line's fill gradient is determined by the advances/declines of the "Momentum Balance".
• The orange divergence dots are calculated using discrepancies between the polarity of the "On Bar Balance" and the chart's bar.
• The divergence levels are determined using the line's level when a divergence occurs.
• The background's fill gradient is calculated on advances/declines of the "Marker Bias".
• The chart bars are colored using advances/declines of the "Relative Balance". Divergences are shown in orange.
• The intrabar timeframe is automatically determined from the chart's timeframe so that a minimum of 50 intrabars are used to calculate volume delta on historical bars.
Alerts
The configuration of the marker conditions explained further is what determines the conditions that will trigger alerts created from this script. Note that simply selecting the display of markers does not create alerts. To create an alert on this script, you must use ALT-A from the chart. You can create multiple alerts triggering on different conditions from this same script; simply configure the markers so they define the trigger conditions for each alert before creating the alert. The configuration of the script's inputs is saved with the alert, so from then on you can change them without affecting the alert. Alert messages will mention the marker(s) that triggered the specific alert event. Keep in mind, when creating alerts on small chart timeframes, that discrepancies between alert triggers and markers displayed on your chart are to be expected. This is because the alert and your chart are running two distinct instances of the indicator on different servers and different feeds. Also keep in mind that while alerts only trigger on confirmed conditions, they are calculated using realtime calculation mode, which entails that if you refresh your chart and elapsed realtime bars recalculate as historical bars using intrabar inspection, markers will not appear in the same places they appeared in realtime. So it's important to understand that even though the alert conditions are confirmed when they trigger, these alerts will repaint.
Let's go through the sections of the script's inputs.
Columns
The size of the Buy/Sell columns always represents their respective importance on the bar, but the coloring mode for tops and bottoms is independent. The default setup uses a standard coloring mode where the Buy/Sell columns are always in the bull/bear color with a higher intensity for the winning side. Seven other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on "Average Balance", for example, you will have bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "On Bar Balance — Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar. You can display the averages of the Buy and Sell columns. If you do, its coloring is controlled through the "Line" and "Line fill" sections below.
Line and Line fill
You can select the calculation mode and the thickness of the line, and independent calculations to determine the line's color and fill.
Zero Line
The zero line can display dots when all five balances are bull/bear.
Divergences
You first select the detection mode. Divergences occur whenever the up/down direction of the signal does not match the up/down polarity of the bar. Divergences are used in three components of the indicator's visuals: the orange dot, colored chart bars, and to calculate the divergence levels on the line. The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It precludes any attempt to identify a directional bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by the line's position relative to the levels, which is how I think divergences can be put to the most effective use. One of the coloring modes for the line's fill uses advances/declines in the line after divergence events.
Background
The background can show a bull/bear gradient on six different calculations. As with other gradients, you can adjust its brightness to make its importance proportional to how you use it in your analysis.
Chart bars
Chart bars can be colored using seven different methods. You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, and you can choose whether you want to show divergences.
Intrabar Timeframe
This is the intrabar timeframe that will be used to calculate volume delta using intrabar inspection on historical bars. You can choose between four modes. The three "Auto-steps" modes calculate, from the chart's timeframe, the intrabar timeframe where the said number of intrabars will make up the dilation of chart bars. Adjustments are made for non-24x7 markets. "Fixed" mode allows you to select the intrabar timeframe you want. Checking the "Show TF" box will display in the lower-right corner the intrabar timeframe used at any given moment. The proper selection of the intrabar timeframe is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors. Note that historical depth will vary with the intrabar timeframe. The smaller the timeframe, the shallower historical plots you will be.
Markers
Markers appear when the required condition has been confirmed on a closed bar. The configuration of the markers when you create an alert is what determines when the alert will trigger. Five markers are available:
• Balances Agreement : All five balances are either bullish or bearish.
• Double Bumps : A double bump is two consecutive up/down bars with +/‒ volume delta, and rising Buy/Sell volume above its average.
• Divergence confirmations : A divergence is confirmed up/down when the chosen balance is up/down on the previous bar when that bar was down/up, and this bar is up/down.
• Balance Shifts : These are bull/bear transitions of the selected signal.
• Marker Bias Shifts : Marker bias shifts occur when it crosses into bull/bear territory.
Periods
Allows control over the periods of the different moving averages used to calculate the balances.
Volume Discrepancies
Stock exchanges do not report the same volume for intraday and daily (or higher) resolutions. Other variations in how volume information is reported can also occur in other markets, namely Forex, where volume irregularities can even occur between different intraday timeframes. This will cause discrepancies between the total volume on the bar at the chart's timeframe, and the total volume calculated by adding the volume of the intrabars in that bar's dilation. This does not necessarily invalidate the volume delta information calculated from intrabars, but it tells us that we are using partial volume data. A mechanism to detect chart vs intrabar timeframe volume discrepancies is provided. It allows you to define a threshold percentage above which the background will indicate a difference has been detected.
Other Settings
You can control here the display of the gray dot reminder on realtime bars, and the display of error messages if you are using a chart timeframe that is not greater than the fixed intrabar timeframe, when you use that mode. Disabling the message can be useful if you only use realtime mode at chart timeframes that do not support intrabar inspection.
█ RAMBLINGS
On Volume Delta
Volume is arguably the best complement to interpret price action, and I consider volume delta to be the most effective way of processing volume information. In periods of low-volatility price consolidations, volume will typically also be lower than normal, but slight imbalances in the trend of the buy/sell volume balance can sometimes help put early odds on the direction of the break from consolidation. Additionally, the progression of the volume imbalance can help determine the proximity of the breakout. I also find volume delta and the number of divergences very useful to evaluate the strength of trends. In trends, I am looking for "slow and steady", i.e., relatively low volatility and pauses where price action doesn't look like world affairs are being reassessed. In my personal mythology, this type of trend is often more resilient than high-volatility breakouts, especially when volume balance confirms the general agreement of traders signaled by the low-volatility usually accompanying this type of trend. The volume action on pauses will often help me decide between aggressively taking profits, tightening a stop or going for a longer-term movement. As for reversals, they generally occur in high-volatility areas where entering trades is more expensive and riskier. While the identification of counter-trend reversals fascinates many traders to no end, they represent poor opportunities in my view. Volume imbalances often precede reversals, but I prefer to use volume delta information to identify the areas following reversals where I can confirm them and make relatively low-cost entries with better odds.
On "Buy/Sell" Volume
Buying or selling volume are misnomers, as every unit of volume transacted is both bought and sold by two different traders. While this does not keep me from using the terms, there is no such thing as “buy only” or “sell only” volume. Trader lingo is riddled with peculiarities.
Divergences
The divergence detection method used here relies on a difference between the direction of a signal and the polarity (up/down) of a chart bar. When using the default "On Bar Balance" to detect divergences, however, only the bar's volume delta is used. You may wonder how there can be divergences between buying/selling volume information and price movement on one bar. This will sometimes be due to the calculation's shortcomings, but divergences may also occur in instances where because of order book structure, it takes less volume to increase the price of an asset than it takes to decrease it. As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. To your pattern-hungry brain, the divergences displayed by this indicator will — as they do on other indicators — appear to often indicate turnarounds. My opinion is that reality is generally quite sobering and I have no reliable information that would tend to prove otherwise. Exercise caution when using them. Consequently, I do not share the overwhelming enthusiasm of traders in identifying bullish/bearish divergences. For me, the best course of action when a divergence occurs is to wait and see what happens from there. That is the rationale underlying how my divergence levels work; they take note of a signal's level when a divergence occurs, and it's the signal's behavior from that point on that determines if the post-divergence action is bullish/bearish.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . This indicator can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to it and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reason — not for window dressing.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars — which is not officially supported by TradingView.
It has the advantage of permitting a more robust calculation of volume delta than other methods on historical bars, but also has its limits.
• Intrabar inspection only works on some chart timeframes: 3, 5, 10, 15 and 30 minutes, 1, 2, 3, 4, 6, and 12 hours, 1 day, 1 week and 1 month.
The script’s code can be modified to run on other resolutions.
• When the difference between the chart’s timeframe and the intrabar timeframe is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
• All volume is not created equally. Its source, components, quality and reliability will vary considerably with sectors and instruments.
The higher the quality, the more reliably volume delta information can be used to guide your decisions.
You should make it your responsibility to understand the volume information provided in the data feeds you use. It will help you make the most of volume delta.
█ NOTES
For traders
• The Data Window shows key values for the indicator.
• While this indicator displays some of the same information calculated in my Delta Volume Columns ,
I have elected to make it a separate publication so that traders continue to have a simpler alternative available to them. Both code bases will continue to evolve separately.
• All gradients used in this indicator determine their brightness intensities using advances/declines in the signal—not their relative position in a pre-determined scale.
• Volume delta being relative, by nature, it is particularly well-suited to Forex markets, as it filters out quite elegantly the cyclical volume data characterizing the sector.
If you are interested in volume delta, consider having a look at my other "Delta Volume" indicators:
• Delta Volume Realtime Action displays realtime volume delta and tick information on the chart.
• Delta Volume Candles builds volume delta candles on the chart.
• Delta Volume Columns is a simpler version of this indicator.
For coders
• I use the `f_c_gradientRelativePro()` from the PineCoders Color Gradient Framework to build my gradients.
This function has the advantage of allowing begin/end colors for both the bull and bear colors. It also allows us to define the number of steps allowed for each gradient.
I use this to modulate the gradients so they perform optimally on the combination of the signal used to calculate advances/declines,
but also the nature of the visual component the gradient applies to. I use fewer steps for choppy signals and when the gradient is used on discrete visual components
such as volume columns or chart bars.
• I use the PineCoders Coding Conventions for Pine to write my scripts.
• I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
█ THANKS TO:
— The devs from TradingView's Pine and other teams, and the PineCoders who collaborate with them. They are doing amazing work,
and much of what this indicator does could not be done without their recent improvements to Pine.
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator using a `for` loop.
This indicator started from the intrabar inspection technique illustrated in Kuan's snippet.
— theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`’s behavior at intrabar timeframes.
— midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics.
Volume AccumulationA simple tool that accumulates the trading volume of an instrument for a specified period of time.
Available modes:
Minutely
Hourly
Session
Daily
Monthly
Quarterly
Yearly