VP and POCThis code is credited to juliangonzaconde. Have taken his help to modify his beautiful creation.
Volume profile is a key study when comes to understanding the auction trading process. Volume Profiles will show you exactly how much volume, as well as relative volume, occurred at each price as well as the exact number of contracts for the entire session. It is a visualization tool to understand the high activity zone and low activity zone.
Volume profile measures the confidence of the traders in the market. From short term trading perspective monitoring the developing volume profile in realtime make more sense to track current market participation behavior to take better trading decisions.
Hope this helps you in trading on daily timeframe.
Happy Trading.
Wyszukaj w skryptach "volume profile"
MM Day Trader LevelsAs an intraday trader, there are certain key levels that I care about for short-term price action on every single chart. When I first began day trading, each morning I would painstakingly mark those key levels off on the charts I planned to trade each day. Depending on the number of charts I was watching, this would take up quite a bit of my time that I felt would have been much better spent doing other things. It also meant that those levels would often be left behind, and on later days I might be trading a symbol and get confused when a line appeared and I'd be paying attention to it only to later discover that it wasn't from prior day, but from some other day in the past when I had marked it off.
I looked all over TradingView to find indicators that did this automatically for me, and I found a lot of them. One by one I tried them, and inevitably I would always find that something was wrong with them. Often they didn't have all of the levels I wanted (so I would have to combine multiple indicators), but more often I found that the levels would be incorrect, or they would be buggy and not appear consistently, or they would not appear at the right time, or they would not work on futures! The list of problems went on and on. And the biggest issue I found was that nobody knew how to get session volume profile in an indicator.
So, over the course of a few years I figured out how to solve all of those problems and now I'm thrilled to present this free indicator for everyone like me who trades intraday and wants a clean consistent way to see the prior day levels that they care about automatically on every single chart (even futures). The levels the indicator provides are:
Yesterday High & Low
Value Area High & Low & Point of Control
Today's Open
Yesterday's Close (aka "Settlement" on futures)
Premarket High & Low (non-futures only)
Overnight High & Low (futures only)
These levels are extremely important, and I expect price to be reactive to them, so each level has a shaded background behind it so that the levels stand out against other lines you may have on your chart. I try to keep configuration as simple as possible, but there are configuration options that allow you to:
Hide any of the levels
Change the color for the levels
Shade the value area (or not)
Change the label text, size, type (basic label or plain text) and location (how far to the right of last candle to place the label
Adjust session volume profile value area volume & number of rows
The biggest advantage to this indicator over others on TradingView is how it handles session volume profile. When it comes to futures, TradingView does differentiate between regular trading hours and "electronic" trading hours on the charts, but their timeframes for those sessions are unusual, and they do not provide any programmatic way to differentiate between them. So, I created a whole new library for dealing with futures sessions that is fully integrated into both my Session Volume Profile library and this indicator, allowing me to bring you the best and only custom indicator available on TradingView that provides you with true regular session volume profile information across every type of symbol, including futures.
I'm incredibly proud of everything I've been able to provide with this indicator, and even more thrilled to say that I'm proud of how the indicator has been implemented. Once again releasing this indicator and all associated code for free and open source. I encourage you to take a look at the source code to see how it all works, take advantage of the free underlying libraries I created to make all of this possible: Session Library and Session Volume Profile Library.
Volume Positive & Negative Levels [ChartPrime]Volume Positive & Negative Levels
Overview:
The Volume Positive & Negative Levels indicator by ChartPrime is designed to provide traders with a clear visualization of volume activity across different price levels. By plotting volume levels as histograms, this tool helps identify significant areas of buying (positive volume) and selling (negative volume) pressure, enhancing the ability to spot potential support and resistance zones.
Key Features:
⯁ Lookback Period:
- The `lookbackPeriod` parameter, set to 500 bars, determines the range over which the volume analysis is conducted, ensuring a comprehensive view of the market’s volume activity. The maximum lookback period is 500 bars or the bars currently visible on the chart, whichever is smaller.
⯁ Dynamic Volume Calculation:
- Volume is calculated dynamically based on the price action, with positive volume indicating buying pressure (close > open) and negative volume indicating selling pressure (close < open).
⯁ Color Coding for Clarity:
- Positive Volume: Represented with a distinct color (`#ad9a2c`), making it easy to identify areas of buying interest.
- Negative Volume: Highlighted with another color (`#ad2cad`), simplifying the detection of selling pressure.
Volume Threshold and Bins:
- The indicator allows users to set a volume threshold (`volume_level`) to highlight significant volume levels, with the default set at 70.
- The number of bins (`numBins`) defines the granularity of the volume profile, with a higher number providing more detail.
⯁ Volume Profile Visualization:
- The volume profile is plotted as a histogram, with the height of each bar proportional to the volume at that price level. This visualization helps in quickly assessing the strength of volume at various price points.
⯁ Interactive Labels and Threshold Indicators:
- Labels: The indicator uses labels to mark significant volume levels, providing quick reference points for traders.
- Threshold Lines: Lines are drawn at specified volume thresholds, with colors and widths dynamically adjusted based on the volume levels.
⯁ User Inputs:
- Volume Threshold (`volume_level`): Sets the minimum volume required to highlight significant levels.
- Number of Bins (`numBins`): Determines the resolution of the volume profile.
- Line Width (`line_withd`): Specifies the width of the lines used in the visualization.
The Volume Positive & Negative Levels indicator is a powerful tool for traders looking to gain deeper insights into market dynamics. By providing a clear visual representation of volume activity across different price levels, it helps traders identify key support and resistance zones, spot trends, and make more informed trading decisions. Whether you are a day trader or a swing trader, this indicator enhances your ability to analyze volume data effectively, improving your overall trading strategy.
Profile Any Indicator [Kioseff Trading]Create a visible-range profile for almost any indicator!
Hello!
This script "Profile Any Indicator" allows you to create a visible-range profile for *almost* any indicator hosted on TradingView.
Therefore, the only requirement:
1. Indicator must have a retrievable plot value.
Should your indicator have a retrievable plot value (most indicators do), you can use this script to create a visible-range profile of its values!
Consequently, the profile's always oriented to the left-most or right-most side of your chart - updating as you scroll left or right.
The image above shows me using the indicator to create a profile for MACD. I am largely zoomed out and the profile has adjusted to chart orientation.
Let's zoom in and see what happens!
Voila!
The indicator adjusted to my chart positioning and created a new visible-range profile! No manual adjustments are required (:
Instructions
1. Load the indicator you'd like to profile on the chart.
The image above shows me applying the OBV indicator to the chart. Additionally, the "Profile Any Indicator" script is also loaded on the chart, instructing me to add an indicator to its settings.
2. From the settings for "Profile Any indicator", locate the "Indicator" setting and select the indicator you would like to profile.
The image above shows me selecting the OBV indicator in the settings for "Profile Any Indicator".
Once steps 1 and 2 are complete you'll have a visible-range profile for the selected indicator on your chart!
The image above shows the completion of the process.
3. Merge the indicator pane or select to plot the selected indicator in the current pane.
From here, you can select to plot the value of the selected indicator in the current pane or merge the selected indicator's pane (which must stay on the chart) with the pane designated to the "Profile Any Indicator" script.
The image above shows the two panes merged.
The image above shows the two panes separate. Alternatively, in the settings for "Profile Any Indicator", I selected to plot OBV in its pane.
You can select to populate the visible-range profile on the right of the chart!
Additionally, you can modify the POC line, value area %, and, essentially, any parameter you'd find for a volume-profile-like indicator!
Thanks for checking this out (:
Normal Distribution CurveThis Normal Distribution Curve is designed to overlay a simple normal distribution curve on top of any TradingView indicator. This curve represents a probability distribution for a given dataset and can be used to gain insights into the likelihood of various data levels occurring within a specified range, providing traders and investors with a clear visualization of the distribution of values within a specific dataset. With the only inputs being the variable source and plot colour, I think this is by far the simplest and most intuitive iteration of any statistical analysis based indicator I've seen here!
Traders can quickly assess how data clusters around the mean in a bell curve and easily see the percentile frequency of the data; or perhaps with both and upper and lower peaks identify likely periods of upcoming volatility or mean reversion. Facilitating the identification of outliers was my main purpose when creating this tool, I believed fixed values for upper/lower bounds within most indicators are too static and do not dynamically fit the vastly different movements of all assets and timeframes - and being able to easily understand the spread of information simplifies the process of identifying key regions to take action.
The curve's tails, representing the extreme percentiles, can help identify outliers and potential areas of price reversal or trend acceleration. For example using the RSI which typically has static levels of 70 and 30, which will be breached considerably more on a less liquid or more volatile asset and therefore reduce the actionable effectiveness of the indicator, likewise for an asset with little to no directional volatility failing to ever reach this overbought/oversold areas. It makes considerably more sense to look for the top/bottom 5% or 10% levels of outlying data which are automatically calculated with this indicator, and may be a noticeable distance from the 70 and 30 values, as regions to be observing for your investing.
This normal distribution curve employs percentile linear interpolation to calculate the distribution. This interpolation technique considers the nearest data points and calculates the price values between them. This process ensures a smooth curve that accurately represents the probability distribution, even for percentiles not directly present in the original dataset; and applicable to any asset regardless of timeframe. The lookback period is set to a value of 5000 which should ensure ample data is taken into calculation and consideration without surpassing any TradingView constraints and limitations, for datasets smaller than this the indicator will adjust the length to just include all data. The labels providing the percentile and average levels can also be removed in the style tab if preferred.
Additionally, as an unplanned benefit is its applicability to the underlying price data as well as any derived indicators. Turning it into something comparable to a volume profile indicator but based on the time an assets price was within a specific range as opposed to the volume. This can therefore be used as a tool for identifying potential support and resistance zones, as well as areas that mark market inefficiencies as price rapidly accelerated through. This may then give a cleaner outlook as it eliminates the potential drawbacks of volume based profiles that maybe don't collate all exchange data or are misrepresented due to large unforeseen increases/decreases underlying capital inflows/outflows.
Thanks to @ALifeToMake, @Bjorgum, vgladkov on stackoverflow (and possibly some chatGPT!) for all the assistance in bringing this indicator to life. I really hope every user can find some use from this and help bring a unique and data driven perspective to their decision making. And make sure to please share any original implementaions of this tool too! If you've managed to apply this to the average price change once you've entered your position to better manage your trade management, or maybe overlaying on an implied volatility indicator to identify potential options arbitrage opportunities; let me know! And of course if anyone has any issues, questions, queries or requests please feel free to reach out! Thanks and enjoy.
Pin Candle DetectionPin candles are a variation of hammer candles that are useful in technical analysis . In particular, when combined with volume profile studies, they can be a powerful set up for long entries or other decision making.
For example, when looking at volume profiles, a long entry would be a fair value area (i.e. 40%) below the close of a pin candle. When combined with a support level , the set up is stronger.
While most scripts look for hammer candles, pin candles are somewhat different in that the length of the wick is significant.
This script and its parameters was built for ES futures 15 min chart in mind.
This script is unique in that it allows for the below parameters to be adjusted to suit other instruments and timeframes:
1. Fib level: Candle must close within a certain retracement level). My preference is 0.55. Some traders like 0.5, while others prefer 0.33
2. Wick length: Pin candles differ from pure hammers in that the length of the wick must be significant. My preference is 7 points on ES (as in $ and not ticks)
Add this script to your alerts to no longer miss these set ups.
Bar Bodies [vnhilton]Note: Go to "Chart Settings" & hide "Body" & "Borders". Also uncheck "Labels on price scale" & "Values in status line" as they're not needed.
This script plots candlestick bodies with the same thickness as the wicks (similar to the bar chart, but without the horizontal lines to represent the open & close). To do this, it plots an invisible candlestick body with an invisible candlestick border from the high to the close/open for a green/red candle respectively, & uses the low wick as the candlestick body itself by plotting it from the low price to the open/close for a green/red candle respectively.
My personal use for this script is to use it in conjunction with TradingView's Periodic Volume Profile, in order to still see OHLC data without obstructing the candlesticks' volume profiles, as seen in the chart snapshot image above.
Liquidity Levels/Voids (VP) [LuxAlgo]The Liquidity Levels/Voids (VP) is a script designed to detect liquidity voids & levels by measuring traded volume at all price levels on the market between two swing points and highlighting the distribution of the liquidity voids & levels at specific price levels.
🔶 USAGE
Liquidity is a fundamental market force that shapes the trajectory of assets.
The creation of a liquidity level comes as a result of an initial imbalance of supply/demand, which forms what we know as a swing high or swing low. As more players take positions in the market, these are levels that market participants will use as a historical reference to place their stops. When the levels are then re-tested, a decision will be made. The binary outcome here can be a breakout of the level or a reversal back to the mean.
Liquidity voids are sudden price changes that occur in the market when the price jumps from one level to another with little trading activity (low volume), creating an imbalance in price. The price tends to fill or retest the liquidity voids area, and traders understand at which price level institutional players have been active.
Liquidity voids are a valuable concept in trading, as they provide insights about where many orders were injected, creating this inefficiency in the market. The price tends to restore the balance.
🔶 SETTINGS
The script takes into account user-defined parameters and detects the liquidity voids based on them, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Levels / Voids
Liquidity Levels/Voids: Color customization option for Unfilled Liquidity Levels/Voids.
Detection Length: Lookback period used for the calculation of Swing Levels.
Threshold %: Threshold used for the calculation of the Liquidity Levels & Voids.
Sensitivity: Adjusts the number of levels between two swing points, as a result, the height of a level is determined, and then based on the above-given threshold the level is checked if it matches the liquidity level/void conditions.
Filled Liquidity Levels/Voids: Toggles the visibility of the Filled Liquidity Levels/Voids and color customization option for Filled Liquidity Levels/Voids.
🔹 Other Features
Swing Highs/Lows: Toggles the visibility of the Swing Levels, where tooltips present statistical information, such as price, price change, and cumulative volume between the two swing levels detected based on the detection length specified above, Coloring options to customize swing low and swing high label colors, and Size option to adjust the size of the labels.
🔹 Display Options
Mode: Controls the lookback length of detection and visualization.
# Bars: Lookback length customization, in case Mode is set to Present.
🔶 RELATED SCRIPTS
Liquidity-Voids-FVG
Buyside-Sellside-Liquidity
Swing-Volume-Profiles
Historic VPoCs and pseudo VPVRThis study tries to recreate session based historic VPoCs
and VPVR Volume Profile
as they are used by
TradingLatino TradingView user.
It's aimed at BTCUSDT pair and 4h timeframe.
HOW IT WORKS
HOW IT WORKS - VPVR Profile Block
It gathers volume from the last chosen Bars
in order to draw the vpvr profile block
Volume that intersects with current level range
being studied is added to its value.
Additionally the current level price is modified
so that it matches the level price where most
of the volume has concentrated
So you get a pretty accurate price for drawn volume
while at the same time the levels are not stuck
to arbitrary level prices.
HOW IT WORKS - VPoC
It calculates a Volume Profile for the
given historic session but then
it only outputs that Volume Profile VPoC.
SETTINGS
Show VPVR Volume Profile {True}.
Show Historic VPoC lines {True}.
Show Historic VPoC labels {True}.
Extend Historic VPoC lines {True}: If this option is turned off the VPoC lines are only shown during the session duration.
Show tick difference from current price {False}: BETA. Feedback is needed because I'm not sure how it should work this setting.
VPVR Number of bars {100}: Define the Visible Range in number of bars so that its Volume Profile can be shown.
VPVR Profile width (in bars) {15}: VPVR Profile can be make larger or smaller in width thanks to this option.
VPVR Profile offset (in bars) {15}: VPVR Profile can be shown more to the left or to the right if the defaults do not suit you.
Historic Session Volume Profile timeframe {1D}: Historic VPoC use 1 day as their timeframe reference by default.
Number of decimal digits {2}: How many decimal digits are shown in label prices.
Number of previous sessions to print VPoC {5}: How many previous sessions VPoCs are to be printed. The maximum for this setting is 20.
Historic VPoC lines width (in pixels) {2}.
Historic VPoC labels size {small}.
History VPoC line offset (in bars) {5}: How far to the right VPoCs lines are to be extended. Note: This setting does not apply when 'Extend Historic VPoC lines' is set to 'False'.
WARNING
Please be aware that VPoC from the first previous session might not be accurate due to Pine Script limitations.
VPVR USAGE
This is not a VPVR like the official TradingView indicator.
This is a pseudo VPVR and that means it needs some manual input from you.
But, don't worry it's quite easy to do and if you always use the same number
of bars to calculate your VPVR then you might even just set it up once.
In order to show the VPVR (or Volume Profile on the Visible Range):
Rescale your chart so that you see all the bars for your Visible Range.
Click on the ruler tool.
Click on the last bar (far to the right) shown on the screen
Drag the ruler to first bar (far to the left) shown on the screen
Check what the ruler says
E.g. it says: 101 bars
Open this study settings
Modify: 'VPVR Number of bars ' setting
So that its value matches your measured number of bars (101)
Press OK to confirm and wait for the indicator to refresh.
STRATEGY USAGE
If your strategy uses VPoC
to define your resistances
or supports
you can check the VPoCs shown here.
FEEDBACK
I have only used this identifier in BTCUSDT 4h timeframe.
I'm interested to know what needs to be tweaked
in other securities and timeframes.
PINE STUDY TRICK
This study let's you choose the number of decimals the label will use.
CREDITS
I have reused and adapted some code from
'Poor man's volume profile' study
which it's from TradingView IldarAkhmetgaleev user.
I also wanted to thank him for helping me understanding his study.
I have reused some code from
'MTF Selection Framework - PineCoders FAQ' study
which it's from TradingView PineCoders user.
Multiple Naked LevelsPURPOSE OF THE INDICATOR
This indicator autogenerates and displays naked levels and gaps of multiple types collected into one simple and easy to use indicator.
VALUE PROPOSITION OF THE INDICATOR AND HOW IT IS ORIGINAL AND USEFUL
1) CONVENIENCE : The purpose of this indicator is to offer traders with one coherent and robust indicator providing useful, valuable, and often used levels - in one place.
2) CLUSTERS OF CONFLUENCES : With this indicator it is easy to identify levels and zones on the chart with multiple confluences increasing the likelihood of a potential reversal zone.
THE TYPES OF LEVELS AND GAPS INCLUDED IN THE INDICATOR
The types of levels include the following:
1) PIVOT levels (Daily/Weekly/Monthly) depicted in the chart as: dnPIV, wnPIV, mnPIV.
2) POC (Point of Control) levels (Daily/Weekly/Monthly) depicted in the chart as: dnPoC, wnPoC, mnPoC.
3) VAH/VAL STD 1 levels (Value Area High/Low with 1 std) (Daily/Weekly/Monthly) depicted in the chart as: dnVAH1/dnVAL1, wnVAH1/wnVAL1, mnVAH1/mnVAL1
4) VAH/VAL STD 2 levels (Value Area High/Low with 2 std) (Daily/Weekly/Monthly) depicted in the chart as: dnVAH2/dnVAL2, wnVAH2/wnVAL2, mnVAH1/mnVAL2
5) FAIR VALUE GAPS (Daily/Weekly/Monthly) depicted in the chart as: dnFVG, wnFVG, mnFVG.
6) CME GAPS (Daily) depicted in the chart as: dnCME.
7) EQUILIBRIUM levels (Daily/Weekly/Monthly) depicted in the chart as dnEQ, wnEQ, mnEQ.
HOW-TO ACTIVATE LEVEL TYPES AND TIMEFRAMES AND HOW-TO USE THE INDICATOR
You can simply choose which of the levels to be activated and displayed by clicking on the desired radio button in the settings menu.
You can locate the settings menu by clicking into the Object Tree window, left-click on the Multiple Naked Levels and select Settings.
You will then get a menu of different level types and timeframes. Click the checkboxes for the level types and timeframes that you want to display on the chart.
You can then go into the chart and check out which naked levels that have appeared. You can then use those levels as part of your technical analysis.
The levels displayed on the chart can serve as additional confluences or as part of your overall technical analysis and indicators.
In order to back-test the impact of the different naked levels you can also enable tapped levels to be depicted on the chart. Do this by toggling the 'Show tapped levels' checkbox.
Keep in mind however that Trading View can not shom more than 500 lines and text boxes so the indocator will not be able to give you the complete history back to the start for long duration assets.
In order to clean up the charts a little bit there are two additional settings that can be used in the Settings menu:
- Selecting the price range (%) from the current price to be included in the chart. The default is 25%. That means that all levels below or above 20% will not be displayed. You can set this level yourself from 0 up to 100%.
- Selecting the minimum gap size to include on the chart. The default is 1%. That means that all gaps/ranges below 1% in price difference will not be displayed on the chart. You can set the minimum gap size yourself.
BASIC DESCRIPTION OF THE INNER WORKINGS OF THE INDICTATOR
The way the indicator works is that it calculates and identifies all levels from the list of levels type and timeframes above. The indicator then adds this level to a list of untapped levels.
Then for each bar after, it checks if the level has been tapped. If the level has been tapped or a gap/range completely filled, this level is removed from the list so that the levels displayed in the end are only naked/untapped levels.
Below is a descrition of each of the level types and how it is caluclated (algorithm):
PIVOT
Daily, Weekly and Monthly levels in trading refer to significant price points that traders monitor within the context of a single trading day. These levels can provide insights into market behavior and help traders make informed decisions regarding entry and exit points.
Traders often use D/W/M levels to set entry and exit points for trades. For example, entering long positions near support (daily close) or selling near resistance (daily close).
Daily levels are used to set stop-loss orders. Placing stops just below the daily close for long positions or above the daily close for short positions can help manage risk.
The relationship between price movement and daily levels provides insights into market sentiment. For instance, if the price fails to break above the daily high, it may signify bearish sentiment, while a strong breakout can indicate bullish sentiment.
The way these levels are calculated in this indicator is based on finding pivots in the chart on D/W/M timeframe. The level is then set to previous D/W/M close = current D/W/M open.
In addition, when price is going up previous D/W/M open must be smaller than previous D/W/M close and current D/W/M close must be smaller than the current D/W/M open. When price is going down the opposite.
POINT OF CONTROL
The Point of Control (POC) is a key concept in volume profile analysis, which is commonly used in trading.
It represents the price level at which the highest volume of trading occurred during a specific period.
The POC is derived from the volume traded at various price levels over a defined time frame. In this indicator the timeframes are Daily, Weekly, and Montly.
It identifies the price level where the most trades took place, indicating strong interest and activity from traders at that price.
The POC often acts as a significant support or resistance level. If the price approaches the POC from above, it may act as a support level, while if approached from below, it can serve as a resistance level. Traders monitor the POC to gauge potential reversals or breakouts.
The way the POC is calculated in this indicator is by an approximation by analysing intrabars for the respective timeperiod (D/W/M), assigning the volume for each intrabar into the price-bins that the intrabar covers and finally identifying the bin with the highest aggregated volume.
The POC is the price in the middle of this bin.
The indicator uses a sample space for intrabars on the Daily timeframe of 15 minutes, 35 minutes for the Weekly timeframe, and 140 minutes for the Monthly timeframe.
The indicator has predefined the size of the bins to 0.2% of the price at the range low. That implies that the precision of the calulated POC og VAH/VAL is within 0.2%.
This reduction of precision is a tradeoff for performance and speed of the indicator.
This also implies that the bigger the difference from range high prices to range low prices the more bins the algorithm will iterate over. This is typically the case when calculating the monthly volume profile levels and especially high volatility assets such as alt coins.
Sometimes the number of iterations becomes too big for Trading View to handle. In these cases the bin size will be increased even more to reduce the number of iterations.
In such cases the bin size might increase by a factor of 2-3 decreasing the accuracy of the Volume Profile levels.
Anyway, since these Volume Profile levels are approximations and since precision is traded for performance the user should consider the Volume profile levels(POC, VAH, VAL) as zones rather than pin point accurate levels.
VALUE AREA HIGH/LOW STD1/STD2
The Value Area High (VAH) and Value Area Low (VAL) are important concepts in volume profile analysis, helping traders understand price levels where the majority of trading activity occurs for a given period.
The Value Area High/Low is the upper/lower boundary of the value area, representing the highest price level at which a certain percentage of the total trading volume occurred within a specified period.
The VAH/VAL indicates the price point above/below which the majority of trading activity is considered less valuable. It can serve as a potential resistance/support level, as prices above/below this level may experience selling/buying pressure from traders who view the price as overvalued/undervalued
In this indicator the timeframes are Daily, Weekly, and Monthly. This indicator provides two boundaries that can be selected in the menu.
The first boundary is 70% of the total volume (=1 standard deviation from mean). The second boundary is 95% of the total volume (=2 standard deviation from mean).
The way VAH/VAL is calculated is based on the same algorithm as for the POC.
However instead of identifying the bin with the highest volume, we start from range low and sum up the volume for each bin until the aggregated volume = 30%/70% for VAL1/VAH1 and aggregated volume = 5%/95% for VAL2/VAH2.
Then we simply set the VAL/VAH equal to the low of the respective bin.
FAIR VALUE GAPS
Fair Value Gaps (FVG) is a concept primarily used in technical analysis and price action trading, particularly within the context of futures and forex markets. They refer to areas on a price chart where there is a noticeable lack of trading activity, often highlighted by a significant price movement away from a previous level without trading occurring in between.
FVGs represent price levels where the market has moved significantly without any meaningful trading occurring. This can be seen as a "gap" on the price chart, where the price jumps from one level to another, often due to a rapid market reaction to news, events, or other factors.
These gaps typically appear when prices rise or fall quickly, creating a space on the chart where no transactions have taken place. For example, if a stock opens sharply higher and there are no trades at the prices in between the two levels, it creates a gap. The areas within these gaps can be areas of liquidity that the market may return to “fill” later on.
FVGs highlight inefficiencies in pricing and can indicate areas where the market may correct itself. When the market moves rapidly, it may leave behind price levels that traders eventually revisit to establish fair value.
Traders often watch for these gaps as potential reversal or continuation points. Many traders believe that price will eventually “fill” the gap, meaning it will return to those price levels, providing potential entry or exit points.
This indicator calculate FVGs on three different timeframes, Daily, Weekly and Montly.
In this indicator the FVGs are identified by looking for a three-candle pattern on a chart, signalling a discrete imbalance in order volume that prompts a quick price adjustment. These gaps reflect moments where the market sentiment strongly leans towards buying or selling yet lacks the opposite orders to maintain price stability.
The indicator sets the gap to the difference from the high of the first bar to the low of the third bar when price is moving up or from the low of the first bar to the high of the third bar when price is moving down.
CME GAPS (BTC only)
CME gaps refer to price discrepancies that can occur in charts for futures contracts traded on the Chicago Mercantile Exchange (CME). These gaps typically arise from the fact that many futures markets, including those on the CME, operate nearly 24 hours a day but may have significant price movements during periods when the market is closed.
CME gaps occur when there is a difference between the closing price of a futures contract on one trading day and the opening price on the following trading day. This difference can create a "gap" on the price chart.
Opening Gaps: These usually happen when the market opens significantly higher or lower than the previous day's close, often influenced by news, economic data releases, or other market events occurring during non-trading hours.
Gaps can result from reactions to major announcements or developments, such as earnings reports, geopolitical events, or changes in economic indicators, leading to rapid price movements.
The importance of CME Gaps in Trading is the potential for Filling Gaps: Many traders believe that prices often "fill" gaps, meaning that prices may return to the gap area to establish fair value.
This can create potential trading opportunities based on the expectation of gap filling. Gaps can act as significant support or resistance levels. Traders monitor these levels to identify potential reversal points in price action.
The way the gap is identified in this indicator is by checking if current open is higher than previous bar close when price is moving up or if current open is lower than previous day close when price is moving down.
EQUILIBRIUM
Equilibrium in finance and trading refers to a state where supply and demand in a market balance each other, resulting in stable prices. It is a key concept in various economic and trading contexts. Here’s a concise description:
Market Equilibrium occurs when the quantity of a good or service supplied equals the quantity demanded at a specific price level. At this point, there is no inherent pressure for the price to change, as buyers and sellers are in agreement.
Equilibrium Price is the price at which the market is in equilibrium. It reflects the point where the supply curve intersects the demand curve on a graph. At the equilibrium price, the market clears, meaning there are no surplus goods or shortages.
In this indicator the equilibrium level is calculated simply by finding the midpoint of the Daily, Weekly, and Montly candles respectively.
NOTES
1) Performance. The algorithms are quite resource intensive and the time it takes the indicator to calculate all the levels could be 5 seconds or more, depending on the number of bars in the chart and especially if Montly Volume Profile levels are selected (POC, VAH or VAL).
2) Levels displayed vs the selected chart timeframe. On a timeframe smaller than the daily TF - both Daily, Weekly, and Monthly levels will be displayed. On a timeframe bigger than the daily TF but smaller than the weekly TF - the Weekly and Monthly levels will be display but not the Daily levels. On a timeframe bigger than the weekly TF but smaller than the monthly TF - only the Monthly levels will be displayed. Not Daily and Weekly.
CREDITS
The core algorithm for calculating the POC levels is based on the indicator "Naked Intrabar POC" developed by rumpypumpydumpy (https:www.tradingview.com/u/rumpypumpydumpy/).
The "Naked intrabar POC" indicator calculates the POC on the current chart timeframe.
This indicator (Multiple Naked Levels) adds two new features:
1) It calculates the POC on three specific timeframes, the Daily, Weekly, and Monthly timeframes - not only the current chart timeframe.
2) It adds functionaly by calculating the VAL and VAH of the volume profile on the Daily, Weekly, Monthly timeframes .
Volume Forks [Trendoscope]🎲 Volume Forks - Advanced Price Analysis with Recursive Auto-Pitchfork and Angled Volume Profile
The Volume Forks Indicator is a comprehensive research tool that combines two innovative techniques, Recursive Auto-Pitchfork and Angled Volume Profile . This indicator provides traders with valuable insights into price dynamics by integrating accurate pitchfork drawing and volume analysis over angled levels. The indicator does following things
Detects Pitchfork formations automatically on the chart over Recursive Zigzag
Instead of drawing forks based on fib levels, volume distribution over ABC of pitchfork is calculated and drawn in the direction of the handle.
🎲 Brief about Pitchfork
Pitchfork is drawn when price forms ABC pattern. Pitchfork draws a series of parallel lines in the direction of trend which can be used for support and resistance.
There are many methods of drawing pitchfork. In all cases, a line joining BC will make the base of pitchfork and fork lines are drawn from different points of the base. All the fork lines will be parallel. But, the handle of the base defines the direction of fork lines. Classification of pitchfork is mainly based on the starting and ending points of the handle.
🎲 Regular Types
Here, end of the handle is always fixed and it will be the mid point of B and C.
🎯 Andrews Pitchfork
Handle starts from A and joins the base at mid of B and C.
Forks are drawn based on fib ratios from the handle
🎯 Schiff Pitchfork
Handle starts from Bar of A and price of middle of AB and joins the base at mid of B and C
Forks are drawn based on fib ratios from the handle
🎯 Modified Schiff Pitchfork
Handle starts from mid of A and B and joins the base at mid of B and C
Forks are drawn based on fib ratios from the handle
🎲 Inside Types
Here, C will act as end of the handle which joins the Base BC .
🎯 Andrews Pitchfork (Inside)
Handle starts from A and joins the base at C
Forks are drawn based on fib ratios from the handle
🎯 Schiff Pitchfork (Inside)
Handle starts from Bar of A and price of (A+B)/2 and joins the base at C
Forks are drawn based on fib ratios from the handle
🎯 Modified Schiff Pitchfork (Inside)
Handle starts from mid of A and B and joins the base at C
Forks are drawn based on fib ratios from the handle
🎲 Brief about Pitchfork
The Angled Volume Profile technique expands on the concept of volume profile by measuring volume distribution levels over angled levels rather than just horizontal levels. By selecting a starting point and angle interactively, traders can assess volume distribution within specific price trends. This feature is particularly useful for analysing volume dynamics in trending markets.
🎲 Settings
Indicator settings include few things which determine the scanning of pitchforks and few which determines drawing of volume profile lines.
Please note that, due to pine limitations of 500 lines, if there are too many formations on the chart, volume profile may not appear correctly. If that happens, please reduce the number of volume forks per formation.
Delta Volume Candles [LucF]█ OVERVIEW
This indicator plots on-chart volume delta information using candles that can replace your normal candles, tops and bottoms appended to normal candles, optional MAs of those tops and bottoms levels, a divergence channel and a chart background. The indicator calculates volume delta using intrabar analysis, meaning that it uses the lower timeframe bars constituting each chart bar.
█ CONCEPTS
Volume Delta
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which considerably limits the historical depth of charts and the number of symbols for which tick data is available. Furthermore, historical tick data is not yet available on TradingView.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. It is currently the most precise method usable on TradingView charts. TradingView's Volume Profile built-in indicators use it, as do the CVD - Cumulative Volume Delta Candles and CVD - Cumulative Volume Delta (Chart) indicators published from the TradingView account . My Delta Volume Channels and Volume Delta Columns Pro indicators also use intrabar analysis. Other volume delta indicators such as my Realtime 5D Profile use realtime chart updates to calculate volume delta without intrabar analysis, but that type of indicator only works in real time; they cannot calculate on historical bars.
This is the logic I use to determine the polarity of intrabars, which determines the up or down slot where its volume is added:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar, and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added, and the down volumes subtracted. The resulting value is volume delta for that chart bar, which can be used as an estimate of the buying/selling pressure on an instrument. Not all markets have volume information. Without it, this indicator is useless.
Intrabar analysis
Intrabars are chart bars at a lower timeframe than the chart's. The timeframe used to access intrabars determines the number of intrabars accessible for each chart bar. On a 1H chart, each chart bar of an active market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour.
This indicator automatically calculates an appropriate lower timeframe using the chart's timeframe and the settings you use in the script's "Intrabars" section of the inputs. As it can access lower timeframes as small as seconds when available, the indicator can be used on charts at relatively small timeframes such as 1min, provided the market is active enough to produce bars at second timeframes.
The quantity of intrabars analyzed in each chart bar determines:
• The precision of calculations (more intrabars yield more precise results).
• The chart coverage of calculations (there is a 100K limit to the quantity of intrabars that can be analyzed on any chart,
so the more intrabars you analyze per chart bar, the less chart bars can be calculated by the indicator).
The information box displayed at the bottom right of the chart shows the lower timeframe used for intrabars, as well as the average number of intrabars detected for chart bars and statistics on chart coverage.
Balances
This indicator calculates five balances from volume delta values. The balances are oscillators with a zero centerline; positive values are bullish, and negative values are bearish. It is important to understand the balances as they can be used to:
• Color candle bodies.
• Calculate body and top and bottom divergences.
• Color an EMA channel.
• Color the chart's background.
• Configure markers and alerts.
The five balances are:
1 — Bar Balance : This is the only balance using instant values; it is simply the subtraction of the down volume from the up volume on the bar, so the instant volume delta for that bar.
2 — Average Balance : Calculates a distinct EMA for both the up and down volumes, and subtracts the down EMA from the up EMA.
The result is akin to MACD's histogram because it is the subtraction of two moving averages.
3 — Momentum Balance : Starts by calculating, separately for both up and down volumes, the difference between the same EMAs used in "Average Balance" and
an SMA of twice the period used for the "Average Balance" EMAs. The difference for the up side is subtracted from the difference for the down 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 up and down EMAs used in the "Average Balance".
From those, we calculate two intermediate values using how much the instant up and down volumes on the bar exceed their respective EMA — but with a twist.
If the bar's up volume does not exceed the EMA of up volume, a zero value is used. The same goes for the down volume with the EMA of down volume.
Once we have our two intermediate values for the up and down volumes exceeding their respective MA, we subtract them. The final value is an ALMA of that subtraction.
The rationale behind using zero values when the bar's up/down 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 up/down volumes and their respective MA.
This balance flatlines when the bar's up/down 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 it will flatline. These flat zones should be considered no-trade zones.
5 — Percent Balance : This balance is the ALMA of the ratio of the "Bar Balance" over the total volume for that bar.
From the balances and marker conditions, two more values are calculated:
1 — Marker Bias : This 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.
The periods for all of these balances can be configured in the "Periods" section at the bottom of the script's inputs. As you cannot see the balances on the chart, you can use my Volume Delta Columns Pro indicator in a pane; it can plot the same balances, so you will be able to analyze them.
Divergences
In the context of this indicator, a divergence is any bar where the bear/bull state of a balance (above/below its zero centerline) diverges from the polarity of a chart bar. No directional bias is assigned to divergences when they occur. Candle bodies and tops/bottoms can each be colored differently on divergences detected from distinct balances.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's open and close ) saved when divergences occur. When price (by default the close ) has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Prices breaches of the divergence channel will change its state. Divergence channels can be in one of three different states:
• Bull (green): Price has breached the channel to the upside.
• Bear (red): Price has breached the channel to the downside.
• Neutral (gray): The channel has not yet been breached.
█ HOW TO USE THE INDICATOR
I do not make videos to explain how to use my indicators. I do, however, try hard to include in their description everything one needs to understand what they do. From there, it's up to you to explore and figure out if they can be useful in your trading practice. Communicating in videos what this description and the script's tooltips contain would make for very long videos that would likely exceed the attention span of most people who find this description too long. There is no quick way to understand an indicator such as this one because it uses many different concepts and has quite a bit of settings one can use to modify its visuals and behavior — thus how one uses it. I will happily answer questions on the inner workings of the indicator, but I do not answer questions like "How do I trade using this indicator?" A useful answer to that question would require an in-depth analysis of who you are, your trading methodology and objectives, which I do not have time for. I do not teach trading.
Start by loading the indicator on an active chart containing volume information. See here if you need help.
The default configuration displays:
• Normal candles where the bodies are only colored if the bar's volume has increased since the last bar.
If you want to use this indicator's candles, you may want to disable your chart's candles by clicking the eye icon to the right of the symbol's name in the top left of the chart.
• A top or bottom appended to the normal candles. It represents the difference between up and down volume for that bar
and is positioned at the top or bottom, depending on its polarity. If up volume is greater than down volume, a top is displayed. If down volume is greater, a bottom is plotted.
The size of tops and bottoms is determined by calculating a factor which is the proportion of volume delta over the bar's total volume.
That factor is then used to calculate the top or bottom size relative to a baseline of the average candle body size of the last 100 bars.
• An information box in the bottom right displaying intrabar and chart coverage information.
• A light red background when the intrabar volume differs from the chart's volume by more than 1%.
The script's inputs contain tooltips explaining most of the fields. I will not repeat them here. Following is a brief description of each section of the indicator's inputs which will give you an idea of what the indicator can do:
Normal Candles is where you configure the replacement candles plotted by the script. You can choose from different coloring schemes for their bodies and specify a unique color for bodies where a divergence calculated using the method you choose occurs.
Volume Tops & Botttoms is where you configure the display of tops and bottoms, and their EMAs. The EMAs are calculated from the high point of tops and the low point of bottoms. They can act as a channel to evaluate price, and you can choose to color the channel using a gradient reflecting the advances/declines in the balance of your choice.
Divergence Channel is where you set up the appearance and behavior of the divergence channel. These areas represent levels where price and volume delta information do not converge. They can be interpreted as regions with no clear direction from where one will look for breaches. You can configure the channel to take into account one or both types of divergences you have configured for candle bodies and tops/bottoms.
Background allows you to configure a gradient background color that reflects the advances/declines in the balance of your choice. You can use this to provide context to the volume delta values from bars. You can also control the background color displayed on volume discrepancies between the intrabar and the chart's timeframe.
Intrabars is where you choose the calculation mode determining the lower timeframe used to access intrabars. The indicator uses the chart's timeframe and the type of market you are on to calculate the lower timeframe. Your setting there should reflect which compromise you prefer between the precision of calculations and chart coverage. This is also where you control the display of the information box in the lower right corner of the chart.
Markers allows you to control the plotting of chart markers on different conditions. Their configuration determines when alerts generated from the indicator will fire. Note that in order to generate alerts from this script, they must be created from your chart. See this Help Center page to learn how. Only the last 500 markers will be visible on the chart, but this will not affect the generation of alerts.
Periods is where you configure the periods for the balances and the EMAs used in the indicator.
The raw values calculated by this script can be inspected using the Data Window.
█ INTERPRETATION
Rightly or wrongly, volume delta is considered by many a useful complement to the interpretation of price action. I use it extensively in an attempt to find convergence between my read of volume delta and price movement — not so much as a predictor of future price movement. No system or person can predict the future. Accordingly, I consider people who speak or act as if they know the future with certainty to be dangerous to themselves and others; they are charlatans, imprudent or blissfully ignorant.
I try to avoid elaborate volume delta interpretation schemes involving too many variables and prefer to keep things simple:
• Trends that have more chances of continuing should be accompanied by VD of the same polarity.
In trends, I am looking for "slow and steady". I work from the assumption that traders and systems often overreact, which translates into unproductive volatility.
Wild trends are more susceptible to overreactions.
• I prefer steady VD values over wildly increasing ones, as large VD increases often come with increased price volatility, which can backfire.
Large VD values caused by stopping volume will also often occur on trend reversals with abnormally high candles.
• Prices escaping divergence channels may be leading a trend in that direction, although there is no telling how long that trend will last; could be just a few bars or hundreds.
When price is in a channel, shifts in VD balances can sometimes give us an idea of the direction where price has the most chance of breaking.
• Dwindling VD will often indicate trend exhaustion and predate reversals by many bars, but the problem is that mere pauses in a trend will often produce the same behavior in VD.
I think it is too perilous to infer rigidly from VD decreases.
Divergence Channel
Here I have configured the divergence channels to be visible. First, I set the bodies to display divergences on the default Bar Balance. They are indicated by yellow bodies. Then I activated the divergence channels by choosing to draw levels on body divergences and checked the "Fill" checkbox to fill the channel with the same color as the levels. The divergence channel is best understood as a direction-less area from where a breach can be acted on if other variables converge with the breach's direction:
Tops and Bottoms EMAs
I find these EMAs rather interesting. They have no equivalent elsewhere, as they are calculated from the top and bottom values this indicator plots. The only similarity they have with volume-weighted MAs, including VWAP, is that they use price and volume. This indicator's Tops and Bottoms EMAs, however, use the price and volume delta. While the channel differs from other channels in how it is calculated, it can be used like others, as a baseline from which to evaluate price movement or, alternatively, as stop levels. Remember that you can change the period used for the EMAs in the "Periods" section of the inputs.
This chart shows the EMAs in action, filled with a gradient representing the advances/decline from the Momentum balance. Notice the anomaly in the chart's latest bars where the Momentum balance gradient has been indicating a bullish bias for some time, during which price was mostly below the EMAs. Price has just broken above the channel on positive VD. My interpretation of this situation would be that it is a risky opportunity for a long trade in the larger context where the market has been in a downtrend since the 5th. Intrepid traders choosing to enter here could do so with a "make or break" tight stop that will minimize their losses should the market continue its downtrend while hopefully preserving the potential upside of price continuing on the longer-term uptrend prevalent since the 28th:
█ NOTES
Volume
If you use indicators such as this one which depends on volume information, it is important to realize that the volume data they consume comes from data feeds, and that all data feeds are NOT created equally. Those who create the data feeds we use must make decisions concerning the nature of the transactions they tally and the way they are tallied in each feed, and these decisions affect the nature of our volume data. My Volume X-ray publication discusses some of the reasons why volume information from different timeframes, brokers/exchanges or sectors may vary considerably. I encourage you to read it. This indicator's display of a warning through a background color on volume discrepancies between the timeframe used to access intrabars and the chart's timeframe is an attempt to help you realize these variations in feeds. Don't take things for granted, and understand that the quality of a given feed's volume information affects the quality of the results this indicator calculates.
Markets as ecosystems
I believe it is perilous to think that behavioral patterns you discover in one market through the lens of this or any other indicator will necessarily port to other markets. While this may sometimes be the case, it will often not. Why is that? Because each market is its own ecosystem. As cities do, all markets share some common characteristics, but they also all have their idiosyncrasies. A proportion of a city's inhabitants is always composed of outsiders who come and go, but a core population of regulars and systems is usually the force that actually defines most of the city's observable characteristics. I believe markets work somewhat the same way; they may look the same, but if you live there for a while and pay attention, you will notice the idiosyncrasies. Some things that work in some markets will, accordingly, not work in others. Please keep that in mind when you draw conclusions.
On Up/Down or 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. Without access to order book information, traders work with the assumption that when price moves up during a bar, there was more buying pressure than selling pressure, just as when buy market orders take out limit ask orders in the order book at successively higher levels. The built-in volume indicator available on TradingView uses this logic to color the volume columns green or red. While this script’s calculations are more precise because it analyses intrabars to calculate its information, it uses pretty much the same imperfect logic. Until Pine scripts can have access to how much volume was transacted at the bid/ask prices, our volume delta calculations will remain a mere proxy.
Repainting
• The values calculated on the realtime bar will update as new information comes from the feed.
• Historical values may recalculate if the historical feed is updated or when calculations start from a new point in history.
• Markers and alerts will not repaint as they only occur on a bar's close. Keep this in mind when viewing markers on historical bars,
where one could understandably and incorrectly assume they appear at the bar's open.
To learn more about repainting, see the Pine Script™ User Manual's page on the subject .
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . This indicator can display a lot of information. The inevitable adaptation period you will need to figure out how to use it should help you eliminate all the visuals you do not need. The more you eliminate, the easier it will be to focus on those that are the most useful to your trading practice. Don't be a fool.
█ THANKS
Thanks to alexgrover for his Dekidaka-Ashi indicator. His volume plots on candles were the inspiration for my top/bottom plots.
Kudos to PineCoders for their libraries. I use two of them in this script: Time and lower_tf .
The first versions of this script used functionality that I would not have known about were it not for these two guys:
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator.
— theheirophant , my partner in the exploration of the sometimes weird abysses of request.security() ’s behavior at lower timeframes.
Lockin Strength Indicator (LSI)How It Works:
RSI Calculation: The standard RSI is calculated using a 14-period by default.
Volume Weighting: If enabled, the LSI modifies the RSI by weighting it based on the volume relative to its moving average. This emphasizes periods of high or low volume, which can be particularly useful for Solana-based assets that might have unique volume profiles.
Plotting: The LSI is plotted with standard overbought and oversold levels, and background highlighting makes these areas visually distinct.
Customization:
RSI Length: You can adjust the length of the RSI period.
Overbought/Oversold Levels: You can modify the levels for overbought and oversold signals.
Volume Weighting: You can toggle volume weighting on or off.
This indicator is designed to give you a more nuanced view of Solana cryptocurrencies by combining RSI with volume dynamics.
CVD - Cumulative Volume Delta Candles█ OVERVIEW
This indicator displays cumulative volume delta in candle form. It uses intrabar information to obtain more precise volume delta information than methods using only the chart's timeframe.
█ CONCEPTS
Bar polarity
By bar polarity , we mean the direction of a bar, which is determined by looking at the bar's close vs its open .
Intrabars
Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A lower timeframe is a timeframe that is smaller than the chart's timeframe. This script uses a LTF to access intrabars. The lower the LTF, the more intrabars are analyzed, but the less chart bars can display CVD information because there is a limit to the total number of intrabars that can be analyzed.
Volume delta
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest techniques use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. Our Volume Profile indicators use it. Other volume delta indicators in our Community Scripts such as the Realtime 5D Profile use realtime chart updates to achieve more precise volume delta calculations, but that method cannot be used on historical bars, so those indicators only work in real time.
This is the logic we use to assign intrabar volume to up or down slots:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added and the down volumes subtracted. The resulting value is volume delta for that chart bar.
█ FEATURES
CVD Candles
Cumulative Volume Delta Candles present volume delta information as it evolves during a period of time.
This is how each candle's levels are calculated:
• open : Each candle's' open level is the cumulative volume delta for the current period at the start of the bar.
This value becomes zero on the first candle following a CVD reset.
The candles after the first one always open where the previous candle closed.
The candle's high, low and close levels are then calculated by adding or subtracting a volume value to the open.
• high : The highest volume delta value found in intrabars. If it is not higher than the volume delta for the bar, then that candle will have no upper wick.
• low : The lowest volume delta value found in intrabars. If it is not lower than the volume delta for the bar, then that candle will have no lower wick.
• close : The aggregated volume delta for all intrabars. If volume delta is positive for the chart bar, then the candle's close will be higher than its open, and vice versa.
The candles are plotted in one of two configurable colors, depending on the polarity of volume delta for the bar.
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. This allows you to analyze the progression of volume delta across manageable chunks, which is often more useful than looking at volume delta cumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
• None : Calculations do not reset.
• On a fixed higher timeframe : Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
• At a fixed time that you specify.
• At the beginning of the regular session .
• On a stepped higher timeframe : Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Chart TF HTF
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
The indicator's background shows where resets occur.
Intrabar precision
The precision of calculations increases with the number of intrabars analyzed for each chart bar. It is controlled through the script's "Intrabar precision" input, which offers the following selections:
• Least precise, covering many chart bars
• Less precise, covering some chart bars
• More precise, covering less chart bars
• Most precise, 1min intrabars
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Total volume candles
You can choose to display candles showing the total intrabar volume for the chart bar. This provides you with more context to evaluate a bar's volume delta by showing it relative to the sum of intrabar volume. Note that because of the reasons explained in the "NOTES" section further down, the total volume is the sum of all intrabar volume rather than the volume of the bar at the chart's timeframe.
Total volume candles can be configured with their own up and down colors. You can also control the opacity of their bodies to make them more or less prominent. This publication's chart shows the indicator with total volume candles. They are turned off by default, so you will need to choose to display them in the script's inputs for them to plot.
Divergences
Divergences occur when the polarity of volume delta does not match that of the chart bar. You can identify divergences by coloring the CVD candles differently for them, or by coloring the indicator's background.
Information box
An information box in the lower-left corner of the indicator displays the HTF used for resets, the LTF used for intrabars, and the average quantity of intrabars per chart bar. You can hide the box using the script's inputs.
█ INTERPRETATION
The first thing to look at when analyzing CVD candles is the side of the zero line they are on, as this tells you if CVD is generally bullish or bearish. Next, one should consider the relative position of successive candles, just as you would with a price chart. Are successive candles trending up, down, or stagnating? Keep in mind that whatever trend you identify must be considered in the context of where it appears with regards to the zero line; an uptrend in a negative CVD (below the zero line) may not be as powerful as one taking place in positive CVD values, but it may also predate a movement into positive CVD territory. The same goes with stagnation; a trader in a long position will find stagnation in positive CVD territory less worrisome than stagnation under the zero line.
After consideration of the bigger picture, one can drill down into the details. Exactly what you are looking for in markets will, of course, depend on your trading methodology, but you may find it useful to:
• Evaluate volume delta for the bar in relation to price movement for that bar.
• Evaluate the proportion that volume delta represents of total volume.
• Notice divergences and if the chart's candle shape confirms a hesitation point, as a Doji would.
• Evaluate if the progress of CVD candles correlates with that of chart bars.
• Analyze the wicks. As with price candles, long wicks tend to indicate weakness.
Always keep in mind that unless you have chosen not to reset it, your CVD resets for each period, whether it is fixed or automatically stepped. Consequently, any trend from the preceding period must re-establish itself in the next.
█ NOTES
Know your volume
Traders using volume information should understand the volume data they are using: where it originates and what transactions it includes, as this can vary with instruments, sectors, exchanges, timeframes, and between historical and realtime bars. The information used to build a chart's bars and display volume comes from data providers (exchanges, brokers, etc.) who often maintain distinct feeds for intraday and end-of-day (EOD) timeframes. How volume data is assembled for the two feeds depends on how instruments are traded in that sector and/or the volume reporting policy for each feed. Instruments from crypto and forex markets, for example, will often display similar volume on both feeds. Stocks will often display variations because block trades or other types of trades may not be included in their intraday volume data. Futures will also typically display variations.
Note that as intraday vs EOD variations exist for historical bars on some instruments, differences may also exist between the realtime feeds used on intraday vs 1D or greater timeframes for those same assets. Realtime reporting rules will often be different from historical feed reporting rules, so variations between realtime feeds will often be different from the variations between historical feeds for the same instrument. The Volume X-ray indicator can help you analyze differences between intraday and EOD volumes for the instruments you trade.
If every unit of volume is both bought by a buyer and sold by a seller, how can volume delta make sense?
Traders who do not understand the mechanics of matching engines (the exchange software that matches orders from buyers and sellers) sometimes argue that the concept of volume delta is flawed, as every unit of volume is both bought and sold. While they are rigorously correct in stating that every unit of volume is both bought and sold, they overlook the fact that information can be mined by analyzing variations in the price of successive ticks, or in our case, intrabars.
Our calculations model the situation where, in fully automated order handling, market orders are generally matched to limit orders sitting in the order book. Buy market orders are matched to quotes at the ask level and sell market orders are matched to quotes at the bid level. As explained earlier, we use the same logic when comparing intrabar prices. While using intrabar analysis does not produce results as precise as when individual transactions — or ticks — are analyzed, results are much more precise than those of methods using only chart prices.
Not only does the concept underlying volume delta make sense, it provides a window on an oft-overlooked variable which, with price and time, is the only basic information representing market activity. Furthermore, because the calculation of volume delta also uses price and time variations, one could conceivably surmise that it can provide a more complete model than ones using price and time only. Whether or not volume delta can be useful in your trading practice, as usual, is for you to decide, as each trader's methodology is different.
For Pine Script™ coders
As our latest Polarity Divergences publication, this script uses the recently released request.security_lower_tf() Pine Script™ function discussed in this blog post . It works differently from the usual request.security() in that it can only be used at LTFs, and it returns an array containing one value per intrabar. This makes it much easier for programmers to access intrabar information.
Look first. Then leap.
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.
Simplified Market ProfileVolume Bins: This script divides the price range into num_bins equal price levels. Each bin holds the cumulative volume for that price range.
Profile Length: The number of past bars that the profile considers for building the volume histogram.
Bin Size: The price range between bins is determined by dividing the difference between the highest and lowest prices over the specified range.
Volume Calculation: The script iterates over each bar within the specified range, determining which price bin the bar’s volume should be added to.
Plotting: The script visualizes the volume profile as lines plotted horizontally at different price levels, with thickness proportional to the volume traded at that level.
CVD - Cumulative Volume Delta (Chart)█ OVERVIEW
This indicator displays cumulative volume delta (CVD) as an on-chart oscillator. It uses intrabar analysis to obtain more precise volume delta information compared to methods that only use the chart's timeframe.
The core concepts in this script come from our first CVD indicator , which displays CVD values as plot candles in a separate indicator pane. In this script, CVD values are scaled according to price ranges and represented on the main chart pane.
█ CONCEPTS
Bar polarity
Bar polarity refers to the position of the close price relative to the open price. In other words, bar polarity is the direction of price change.
Intrabars
Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A lower timeframe is a timeframe that is smaller than the chart's timeframe. This script utilizes a LTF to analyze intrabars, or price changes within a chart bar. The lower the LTF, the more intrabars are analyzed, but the less chart bars can display information due to the limited number of intrabars that can be analyzed.
Volume delta
Volume delta is a measure that separates volume into "up" and "down" parts, then takes the difference to estimate the net demand for the asset. This approach gives traders a more detailed insight when analyzing volume and market sentiment. There are several methods for determining whether an asset's volume belongs in the "up" or "down" category. Some indicators, such as On Balance Volume and the Klinger Oscillator , use the change in price between bars to assign volume values to the appropriate category. Others, such as Chaikin Money Flow , make assumptions based on open, high, low, and close prices. The most accurate method involves using tick data to determine whether each transaction occurred at the bid or ask price and assigning the volume value to the appropriate category accordingly. However, this method requires a large amount of data on historical bars, which can limit the historical depth of charts and the number of symbols for which tick data is available.
In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. This indicator uses intrabar analysis to achieve a compromise between simplicity and accuracy in calculating volume delta on historical bars. Our Volume Profile indicators use it as well. Other volume delta indicators in our Community Scripts , such as the Realtime 5D Profile , use real-time chart updates to achieve more precise volume delta calculations. However, these indicators aren't suitable for analyzing historical bars since they only work for real-time analysis.
This is the logic we use to assign intrabar volume to the "up" or "down" category:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars comprising a chart bar are analyzed, we calculate the net difference between "up" and "down" intrabar volume to produce the volume delta for the chart bar.
█ FEATURES
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. By periodically resetting the volume delta accumulation, we can analyze the progression of volume delta across manageable chunks, which is often more useful than looking at volume delta accumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
• None : Calculations do not reset.
• On a fixed higher timeframe : Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
• At a fixed time that you specify.
• At the beginning of the regular session .
• On trend changes : Calculations reset on the direction change of either the Aroon indicator, Parabolic SAR , or Supertrend .
• On a stepped higher timeframe : Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Chart TF HTF
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
Specifying intrabar precision
Ten options are included in the script to control the number of intrabars used per chart bar for calculations. The greater the number of intrabars per chart bar, the fewer chart bars can be analyzed.
The first five options allow users to specify the approximate amount of chart bars to be covered:
• Least Precise (Most chart bars) : Covers all chart bars by dividing the current timeframe by four.
This ensures the highest level of intrabar precision while achieving complete coverage for the dataset.
• Less Precise (Some chart bars) & More Precise (Less chart bars) : These options calculate a stepped LTF in relation to the current chart's timeframe.
• Very precise (2min intrabars) : Uses the second highest quantity of intrabars possible with the 2min LTF.
• Most precise (1min intrabars) : Uses the maximum quantity of intrabars possible with the 1min LTF.
The stepped lower timeframe for "Less Precise" and "More Precise" options is calculated from the current chart's timeframe as follows:
Chart Timeframe Lower Timeframe
Less Precise More Precise
< 1hr 1min 1min
< 1D 15min 1min
< 1W 2hr 30min
> 1W 1D 60min
The last five options allow users to specify an approximate fixed number of intrabars to analyze per chart bar. The available choices are 12, 24, 50, 100, and 250. The script will calculate the LTF which most closely approximates the specified number of intrabars per chart bar. Keep in mind that due to factors such as the length of a ticker's sessions and rounding of the LTF, it is not always possible to produce the exact number specified. However, the script will do its best to get as close to the value as possible.
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Display
This script displays raw or cumulative volume delta values on the chart as either line or histogram oscillator zones scaled according to the price chart, allowing traders to visualize volume activity on each bar or cumulatively over time. The indicator's background shows where CVD resets occur, demarcating the beginning of new zones. The vertical axis of each oscillator zone is scaled relative to the one with the highest price range, and the oscillator values are scaled relative to the highest volume delta. A vertical offset is applied to each oscillator zone so that the highest oscillator value aligns with the lowest price. This method ensures an accurate, intuitive visual comparison of volume activity within zones, as the scale is consistent across the chart, and oscillator values sit below prices. The vertical scale of oscillator zones can be adjusted using the "Zone Height" input in the script settings.
This script displays labels at the highest and lowest oscillator values in each zone, which can be enabled using the "Hi/Lo Labels" input in the "Visuals" section of the script settings. Additionally, the oscillator's value on a chart bar is displayed as a tooltip when a user hovers over the bar, which can be enabled using the "Value Tooltips" input.
Divergences occur when the polarity of volume delta does not match that of the chart bar. The script displays divergences as bar colors and background colors that can be enabled using the "Color bars on divergences" and "Color background on divergences" inputs.
An information box in the lower-left corner of the indicator displays the HTF used for resets, the LTF used for intrabars, the average quantity of intrabars per chart bar, and the number of chart bars for which there is LTF data. This is enabled using the "Show information box" input in the "Visuals" section of the script settings.
FOR Pine Script™ CODERS
• This script utilizes `ltf()` and `ltfStats()` from the lower_tf library.
The `ltf()` function determines the appropriate lower timeframe from the selected calculation mode and chart timeframe, and returns it in a format that can be used with request.security_lower_tf() .
The `ltfStats()` function, on the other hand, is used to compute and display statistical information about the lower timeframe in an information box.
• The script utilizes display.data_window and display.status_line to restrict the display of certain plots.
These new built-ins allow coders to fine-tune where a script’s plot values are displayed.
• The newly added session.isfirstbar_regular built-in allows for resetting the CVD segments at the start of the regular session.
• The VisibleChart library developed by our resident PineCoders team leverages the chart.left_visible_bar_time and chart.right_visible_bar_time variables to optimize the performance of this script.
These variables identify the opening time of the leftmost and rightmost visible bars on the chart, allowing the script to recalculate and draw objects only within the range of visible bars as the user scrolls.
This functionality also enables the scaling of the oscillator zones.
These variables are just a couple of the many new built-ins available in the chart.* namespace.
For more information, check out this blog post or look them up by typing "chart." in the Pine Script™ Reference Manual .
• Our ta library has undergone significant updates recently, including the incorporation of the `aroon()` indicator used as a method for resetting CVD segments within this script.
Revisit the library to see more of the newly added content!
Look first. Then leap.
Delta Volume Channels [LucF]█ OVERVIEW
This indicator displays on-chart visuals aimed at making the most of delta volume information. It can color bars and display two channels: one for delta volume, another calculated from the price levels of bars where delta volume divergences occur. Markers and alerts can also be configured using key conditions, and filtered in many different ways. The indicator caters to traders who prefer chart visuals over raw values. It will work on historical bars and in real time, using intrabar analysis to calculate delta volume in both conditions.
█ CONCEPTS
Delta Volume
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest techniques use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. TradingView's Volume Profile built-in indicators use it, as do the CVD - Cumulative Volume Delta Candles and CVD - Cumulative Volume Delta (Chart) indicators published from the TradingView account . My Volume Delta Columns Pro indicator also uses intrabar analysis. Other volume delta indicators such as my Realtime 5D Profile use realtime chart updates to achieve more precise volume delta calculations. Indicators of that type cannot be used on historical bars however; they only work in real time.
This is the logic I use to assign intrabar volume to up or down slots:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added and the down volumes subtracted. The resulting value is volume delta for that chart bar, which can be used as an estimate of the buying/selling pressure on an instrument.
Delta Volume Percent (DV%)
This value is the proportion that delta volume represents of the total intrabar volume in the chart bar. Note that on some symbols/timeframes, the total intrabar volume may differ from the chart's volume for a bar, but that will not affect our calculations since we use the total intrabar volume.
Delta Volume Channel
The DV channel is the space between two moving averages: the reference line and a DV%-weighted version of that reference. The reference line is a moving average of a type, source and length which you select. The DV%-weighted line uses the same settings, but it averages the DV%-weighted price source.
The weight applied to the source of the reference line is calculated from two values, which are multiplied: DV% and the relative size of the bar's volume in relation to previous bars. The effect of this is that DV% values on bars with higher total volume will carry greater weight than those with lesser volume.
The DV channel can be in one of four states, each having its corresponding color:
• Bull (teal): The DV%-weighted line is above the reference line.
• Strong bull (lime): The bull condition is fulfilled and the bar's close is above the reference line and both the reference and the DV%-weighted lines are rising.
• Bear (maroon): The DV%-weighted line is below the reference line.
• Strong bear (pink): The bear condition is fulfilled and the bar's close is below the reference line and both the reference and the DV%-weighted lines are falling.
Divergences
In the context of this indicator, a divergence is any bar where the slope of the reference line does not match that of the DV%-weighted line. No directional bias is assigned to divergences when they occur.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's low and high ) saved when divergences occur. When price has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Prices breaches of the divergence channel will change its state. Divergence channels can be in one of five different states:
• Bull (teal): Price has breached the channel to the upside.
• Strong bull (lime): The bull condition is fulfilled and the DV channel is in the strong bull state.
• Bear (maroon): Price has breached the channel to the downside.
• Strong bear (pink): The bear condition is fulfilled and the DV channel is in the strong bear state.
• Neutral (gray): The channel has not been breached.
█ HOW TO USE THE INDICATOR
Load the indicator on an active chart (see here if you don't know how).
The default configuration displays:
• The DV channel, without the reference or DV%-weighted lines.
• The Divergence channel, without its level lines.
• Bar colors using the state of the DV channel.
The default settings use an Arnaud-Legoux moving average on the close and a length of 20 bars. The DV%-weighted version of it uses a combination of DV% and relative volume to calculate the ultimate weight applied to the reference. The DV%-weighted line is capped to 5 standard deviations of the reference. The lower timeframe used to access intrabars automatically adjusts to the chart's timeframe and achieves optimal balance between the number of intrabars inspected in each chart bar, and the number of chart bars covered by the script's calculations.
The Divergence channel's levels are determined using the high and low of the bars where divergences occur. Breaches of the channel require a bar's low to move above the top of the channel, and the bar's high to move below the channel's bottom.
No markers appear on the chart; if you want to create alerts from this script, you will need first to define the conditions that will trigger the markers, then create the alert, which will trigger on those same conditions.
To learn more about how to use this indicator, you must understand the concepts it uses and the information it displays, which requires reading this description. There are no videos to explain it.
█ FEATURES
The script's inputs are divided in four sections: "DV channel", "Divergence channel", "Other Visuals" and "Marker/Alert Conditions". The first setting is the selection method used to determine the intrabar precision, i.e., how many lower timeframe bars (intrabars) are examined in each chart bar. The more intrabars you analyze, the more precise the calculation of DV% results will be, but the less chart coverage can be covered by the script's calculations.
DV Channel
Here, you control the visibility and colors of the reference line, its weighted version, and the DV channel between them.
You also specify what type of moving average you want to use as a reference line, its source and length. This acts as the DV channel's baseline. The DV%-weighted line is also a moving average of the same type and length as the reference line, except that it will be calculated from the DV%-weighted source used in the reference line. By default, the DV%-weighted line is capped to five standard deviations of the reference line. You can change that value here. This section is also where you can disable the relative volume component of the weight.
Divergence Channel
This is where you control the appearance of the divergence channel and the key price values used in determining the channel's levels and breaching conditions. These choices have an impact on the behavior of the channel. More generous level prices like the default low and high selection will produce more conservative channels, as will the default choice for breach prices.
In this section, you can also enable a mode where an attempt is made to estimate the channel's bias before price breaches the channel. When it is enabled, successive increases/decreases of the channel's top and bottom levels are counted as new divergences occur. When one count is greater than the other, a bull/bear bias is inferred from it.
Other Visuals
You specify here:
• The method used to color chart bars, if you choose to do so.
• The display of a mark appearing above or below bars when a divergence occurs.
• If you want raw values to appear in tooltips when you hover above chart bars. The default setting does not display them, which makes the script faster.
• If you want to display an information box which by default appears in the lower left of the chart.
It shows which lower timeframe is used for intrabars, and the average number of intrabars per chart bar.
Marker/Alert Conditions
Here, you specify the conditions that will trigger up or down markers. The trigger conditions can include a combination of state transitions of the DV and the divergence channels. The triggering conditions can be filtered using a variety of conditions.
Configuring the marker conditions is necessary before creating an alert from this script, as the alert will use the marker conditions to trigger.
Markers only appear on bar closes, so they will not repaint. Keep in mind, when looking at markers on historical bars, that they are positioned on the bar when it closes — NOT when it opens.
Raw values
The raw values calculated by this script can be inspected using a tooltip and the Data Window. The tooltip is visible when you hover over the top of chart bars. It will display on the last 500 bars of the chart, and shows the values of DV, DV%, the combined weight, and the intermediary values used to calculate them.
█ INTERPRETATION
The aim of the DV channel is to provide a visual representation of the buying/selling pressure calculated using delta volume. The simplest characteristic of the channel is its bull/bear state. One can then distinguish between its bull and strong bull states, as transitions from strong bull to bull states will generally happen when buyers are losing steam. While one should not infer a reversal from such transitions, they can be a good place to tighten stops. Only time will tell if a reversal will occur. One or more divergences will often occur before reversals.
The nature of the divergence channel's design makes it particularly adept at identifying consolidation areas if its settings are kept on the conservative side. A gray divergence channel should usually be considered a no-trade zone. More adventurous traders can use the DV channel to orient their trade entries if they accept the risk of trading in a neutral divergence channel, which by definition will not have been breached by price.
If your charts are already busy with other stuff you want to hold on to, you could consider using only the chart bar coloring component of this indicator:
At its simplest, one way to use this indicator would be to look for overlaps of the strong bull/bear colors in both the DV channel and a divergence channel, as these identify points where price is breaching the divergence channel when buy/sell pressure is consistent with the direction of the breach. I have highlighted all those points in the chart below. Not all of them would have produced profitable trades, but nothing is perfect in the markets. Also, keep in mind that the circles identify the visual you would be looking for — not the trade's entry level.
█ LIMITATIONS
• The script will not work on symbols where no volume is available. An error will appear when that is the case.
• Because a maximum of 100K intrabars can be analyzed by a script, a compromise is necessary between the number of intrabars analyzed per chart bar
and chart coverage. The more intrabars you analyze per chart bar, the less coverage you will obtain.
The setting of the "Intrabar precision" field in the "DV channel" section of the script's inputs
is where you control how the lower timeframe is calculated from the chart's timeframe.
█ NOTES
Volume Quality
If you use volume, it's important to understand its nature and quality, as it varies with sectors and instruments. My Volume X-ray indicator is one way you can appraise the quality of an instrument's intraday volume.
For Pine Script™ Coders
• This script uses the new overload of the fill() function which now makes it possible to do vertical gradients in Pine. I use it for both channels displayed by this script.
• I use the new arguments for plot() 's `display` parameter to control where the script plots some of its values,
namely those I only want to appear in the script's status line and in the Data Window.
• I wrote my script using the revised recommendations in the Style Guide from the Pine v5 User Manual.
█ THANKS
To PineCoders . I have used their lower_tf library in this script, to manage the calculation of the LTF and intrabar stats, and their Time library to convert a timeframe in seconds to a printable form for its display in the Information box.
To TradingView's Pine Script™ team. Their innovations and improvements, big and small, constantly expand the boundaries of the language. What this script does would not have been possible just a few months back.
And finally, thanks to all the users of my scripts who take the time to comment on my publications and suggest improvements. I do not reply to all but I do read your comments and do my best to implement your suggestions with the limited time that I have.
Bitcoin Stalemate IndicatorThe Bitcoin Stalemate Indicator examines periods in the market defined by a combination of high volume and low price volatility. These periods are a bit like a tug-of-war with both sides applying a lot of force but the rope moving very little. Periods of high volume and low volatility suggest both sides of the trade are stuck in a stalemate. This indicator may be useful in identifying psychologically important price levels.
The mechanics of the indicator are fairly simple: the indicator takes the volume and divides it by the candle’s size over it’s close for that same period.
volume / ((high - low) / close)
Candles that move very little but with high volume will produce higher reads and vice versa. Finally a smoothing average is applied to clean up the noise.
Volume profiles from the top 6 exchanges are averaged in order to avoid a single exchange’s popularity acting as an overriding factor. Single exchanges can be isolated but are of lesser use. Heat map functionality is only active when all exchanges are selected.
Market Profile Fixed ViewSome instruments does not provide any volume information, therefore, as a fixed volume profile user, I needed a fixed market profile indicator to use the same principles, regardless of whether the volumes are available or not.
This script draws a market profile histogram corresponding to price variations within a specific duration, you only need to specify Start and End date/time values to see the histogram on your chart.
Details
Two lines corresponding to highest/lowest prices are displayed around the histogram
The redline corresponds to the POC (point of control)
Options
Start calculation
End calculation
Bars number (histogram resolution, currently locked to a max value of 50 bars)
Display side/Width (allows to modify size of bars, to the left or to the right)
Bars/Borders/POC Color customization
Notes
This script will probably be updated (to add VAH/VAL zones, and maybe other options). However, some common market profile attributes have not been implemented yet since I don't really use them)
.srb suiteThe essential suite Indicator.
that are well integrated to ensure visibility of essential items for trading.
it is very cumbersome to put symbol in the Tradingview chart and combine essential individual indicators one by one.
Moreover even with such a combination, the chart is messy and visibility is not good.
This is because each indicator is not designed with the others in mind.
This suite was developed as a composite-solution to that situation, and will make you happy.
designed to work in the same pane with open-source indicator by default.
Recommended visual order ; Back = .srb suite, Front = .srb suite vol & info
individually turn on/off only what you need on the screen.
BTC-agg. Volume
4 BTC-spot & 4 BTC-PERP volume aggregated.
It might helps you don't miss out on important volume flows.
Weighted to spot trading volume when using PERP+spot volume .
If enabled, BTC-agg.Vol automatically applied when selecting BTC-pair.
--> This is used in calculations involving volumes, such as VWAP.
Moving Average
1 x JMA trend ribbon ; Accurately follow short-term trend changes.
3 x EMA ribbon ; zone , not the line.
MA extension line ; It provide high visibility to recognize the direction of the MA.
SPECIAL TOOLS
VWAP with Standard Deviation Bands
VWAP ruler
BB regular (Dev. 2.0, 2.5)
BB Extented (Dev. 2.5, 3.0, 3.5)
Fixed Range Volume Profile ; steamlined one, performace tuned & update.
SPECIAL TOOLS - Auto Fibonacci Retracement - New GUI
'built-in auto FBR ' has been re-born
It shows - retracement Max top/ min bottom ; for higher visibility
It shows - current retracement position ; for higher visibility
The display of the Fib position that exceeds the regular range is auto-determined according to the price.
tradingview | chart setting > Appearance > Top margin 0%, Bottom margin 0% for optimized screen usage
tradingview | chart setting > Appearance > Right margin 57
.srb suite vol & info --> Visual Order > Bring to Front
.srb suite vol & info --> Pin to scale > No scale (Full-screen)
Visual order ; Back = .srb suite, Front = .srb suite vol & info
1. Fib.Retracement core is from tradingview built-in FBR ---> upgrade new-type GUI, and performance tuned.
2. Fixed-range volume-profile core is from the open-source one ---> some update & perf.tuned.
---------------------------------------------------------------------------------------------------------------------------------------
if you have any questions freely contact to me by message on tradingview.
but please understand that responses may be quite late.
Special thanks to all of contributors of community.
The script may be freely distributed under the MIT license.
VPoC per barThis study prints the current bar VPoC as an horizontal line.
It's aimed originally at BTCUSDT pair and 15m timeframe.
HOW IT WORKS
Zoom In mode: This is the default mode.
The study zooms in into the latest 15 1-minute bar candles in order to calculate the 15 minute candle VPoC.
Zoom Out mode: The VPoC from the last n bars from the current timeframe that match desired timeframe is shown on each bar.
In either case you are recommended to click on the '...' button associated to this study
and select 'Visual Order. Bring to Front.' so that it's properly shown in your chart.
HOW IT WORKS - Zoom In mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to true.
Choose the zoomed in timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting.
Change '(VP) Zoomed in timeframe bars per current timeframe bar {15}' to its appropiated value. You just need to divide the current timeframe minutes per the zoomed in timeframe minutes per bar. E.g. If you are in 60 minute timeframe and you want to zoom in into 5 minute timeframe: 60 / 5 = 12 . You will write 12 here.
HOW IT WORKS - Zoom Out mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to false.
If you are using the Zoom out mode you might want to set '(VP) Print VPoC price as discrete lines {True}' to false.
Either choose the zoommed out timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting or turn on the '(VP) Use number of bars (not VP timeframe)' setting in order to use '(VP) Number of bars {100}' as a custom number of bars.
WARNING - Zoom In mode last bar
The way that PineScript handles security function in last bar might result on the last bar not being accurate enough.
SETTINGS
__ SETTINGS - Volume Profile
(VP) Zoomed timeframe {1 minute}: Timeframe in which to zoom in or zoom out to calculate an accurate VPoC for the current timeframe.
(VP) Zoomed in timeframe bars per current timeframe bar {15}: Check 'HOW IT WORKS - Zoom In mode' above. Note : It is only used in 'Zoom in' mode.
(VP) Number of bars {100}: If 'Use number of bars (not VP timeframe)' is turned on this setting is used to calculate session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Price levels {24}: Price levels for calculating VPoC.
__ SETTINGS - MAIN TURN ON/OFF OPTIONS
(VP) Print VPoC price {True}: Show VPoC price
(VP) Zoom into the VP timeframe: When set to true the VPoC is calculated by zooming into the lower timeframe. When set to false a higher timeframe (or number of bars) is used.
(VP) Realtime Zoom in (Beta): Enable real time zoom for the last bar. It's beta because it would only work with zoomed in timeframe under 60 minutes. And when ratio between zoomout and zoomin is less than 60. Note : It is only used in 'Zoom in' mode.
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
__ SETTINGS - EXTRA
(VP) VPoC color: Change the VPoC color
(VP) VPoC line width {1}: Change VPoC line width (in pixels).
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
CREDITS
I have reused and adapted some code from
"Poor man's volume profile" study
which it's from TradingView IldarAkhmetgaleev user.
Bar Balance [LucF]Bar Balance extracts the number of up, down and neutral intrabars contained in each chart bar, revealing information on the strength of price movement. It can display stacked columns representing raw up/down/neutral intrabar counts, or an up/down balance line which can be calculated and visualized in many different ways.
WARNING: This is an analysis tool that works on historical bars only. It does not show any realtime information, and thus cannot be used to issue alerts or for automated trading. When realtime bars elapse, the indicator will require a browser refresh, a change to its Inputs or to the chart's timeframe/symbol to recalculate and display information on those elapsed bars. Once a trader understands this, the indicator can be used advantageously to make discretionary trading decisions.
Traders used to work with my Delta Volume Columns Pro will feel right at home in this indicator's Inputs . It has lots of options, allowing it to be used in many different ways. If you value the bar balance information this indicator mines, I hope you will find the time required to master the use of Bar Balance well worth the investment.
█ OVERVIEW
The indicator has two modes: Columns and Line .
Columns
• In Columns mode you can display stacked Up/Down/Neutral columns.
• The "Up" section represents the count of intrabars where `close > open`, "Down" where `close < open` and "Neutral" where `close = open`.
• The Up section always appears above the centerline, the Down section below. The Neutral section overlaps the centerline, split halfway above and below it.
The Up and Down sections start where the Neutral section ends, when there is one.
• The Up and Down sections can be colored independently using 7 different methods.
• The signal line plotted in Line mode can also be displayed in Columns mode.
Line
• Displays a single balance line using a zero centerline.
• A variable number of independent methods can be used to calculate the line (6), determine its color (5), and color the fill (5).
You can thus evaluate the state of 3 different components with this single line.
• A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Features available in both modes
• The color of all components can be selected from 15 base colors, with 16 gradient levels used for each base color in the indicator's gradients.
• A zero line can show a 6-state aggregate value of the three main volume balance modes.
• The background can be colored using any of 5 different methods.
• Chart bars can be colored using 5 different methods.
• Divergence and large neutral count ratio events can be shown in either Columns or Line mode, calculated in one of 4 different methods.
• Markers on 6 different conditions can be displayed.
█ CONCEPTS
Intrabar inspection
Intrabar inspection means the indicator looks at lower timeframe bars ( intrabars ) making up a given chart bar to gather its information. If your chart is on a 1-hour timeframe and the intrabar resolution determined by the indicator is 5 minutes, then 12 intrabars will be analyzed for each chart bar and the count of up/down/neutral intrabars among those will be tallied.
Bar Balances and calculation methods
The indicator uses a variety of methods to evaluate bar balance and to derive other calculations from them:
1. Balance on Bar : Uses the relative importance of instant Up and Down counts on the bar.
2. Balance Averages : Uses the difference between the EMAs of Up and Down counts.
3. Balance Momentum : Starts by calculating, separately for both Up and Down counts, the difference between the same EMAs used in Balance Averages and an SMA of double the period used for the EMAs. These differences are then aggregated and finally, a bounded momentum of that aggregate is calculated using RSI.
4. Markers Bias : It sums the bull/bear occurrences of the four previous markers over a user-defined period (the default is 14).
5. Combined Balances : This is the aggregate of the instant bull/bear bias of the three main bar balances.
6. Dual Up/Down Averages : This is a display mode showing the EMA calculated for each of the Up and Down counts.
Interpretation of neutral intrabars
What do neutral intrabars mean? When price does not change during a bar, it can be because there is simply no interest in the market, or because of a perfect balance between buyers and sellers. The latter being more improbable, Bar Balance assumes that neutral bars reveal a lack of interest, which entails uncertainty. That is the reason why the option is provided to interpret ratios of neutral intrabars greater than 50% as divergences. It is also the rationale behind the option to dampen signal lines on the inverse ratio of neutral intrabars, so that zero intrabars do not affect the signal, and progressively larger proportions of neutral intrabars will reduce the signal's amplitude, as the balance calcs using the up/down counts lose significance. The impact of the dampening will vary with markets. Weaker markets such as cryptos will often contain greater numbers of neutral intrabars, so dampening the Line in that sector will have a greater impact than in more liquid markets.
█ FEATURES
1 — Columns
• While the size of the Up/Down columns always represents their respective importance on the bar, their coloring mode is independent. The default setup uses a standard coloring mode where the Up/Down columns over/under the zero line are always in the bull/bear color with a higher intensity for the winning side. Six 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 Balance Averages, for example, you will end up with 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 "Up/Down Ratio on Bar — Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar.
• Line mode shows only the line, but Columns mode allows displaying the line along with it. If the scale of the line is different than that of the scale of the columns, the line will often appear flat. Traders may find even a flat line useful as its bull/bear colors will be easily distinguishable.
2 — Line
• The default setup for Line mode uses a calculation on "Balance Momentum", with a fill on the longer-term "Balance Averages" and a line color based on the "Markers Bias". With the background set on "Line vs Divergence Levels" and the zero line on the hard-coded "Combined Bar Balances", you have access to five distinct sources of information at a glance, to which you can add divergences, divergences levels and chart bar coloring. This provides powerful potential in displaying bar balance information.
• When no columns are displayed, Line mode can show the full scale of whichever line you choose to calculate because the columns' scale no longer interferes with the line's scale.
• Note that when "Balance on Bar" is selected, the Neutral count is also displayed as a ratio of the balance line. This is the only instance where the Neutral count is displayed in Line mode.
• The "Dual Up/Down Averages" is an exception as it displays two lines: one average for the Up counts and another for the Down counts. This mode will be most useful when Columns are also displayed, as it provides a reference for the top and bottom columns.
3 — Zero Line
The zero line can be colored using two methods, both based on the Combined Balances, i.e., the aggregate of the instant bull/bear bias of the three main bar balances.
• In "Six-state Dual Color Gradient" mode, a dot appears on every bar. Its color reflects the bull/bear state of the Combined Balances, and the dot's brightness reflects the tally of balance biases.
• In "Dual Solid Colors (All Bull/All Bear Only)" a dot only appears when all three balances are either bullish or bearish. The resulting pattern is identical to that of Marker 1.
4 — Divergences
• Divergences are displayed as a small circle at the top of the scale. Four different types of divergence events can be detected. Divergences occur whenever the bull/bear bias of the method used diverges with the bar's price direction.
• An option allows you to include in divergence events instances where the count of neutral intrabars exceeds 50% of the total intrabar count.
• 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 excludes any association of a pre-determined bullish/bearish 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 price's position relative to the levels, which is how I think divergences can be put to the most effective use.
5 — Background
• The background can show a bull/bear gradient on four different calculations. You can adjust its brightness to make its visual importance proportional to how you use it in your analysis.
6 — Chart bars
• Chart bars can be colored using five different methods.
• You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, the idea behind this being that movement on bars where volume does not increase is less relevant.
7 — Intrabar Resolution
You can choose between three modes. Two of them are automatic and one is manual:
a) Fast, Longer history, Auto-Steps (~12 intrabars) : Optimized for speed and deeper history. Uses an average minimum of 12 intrabars.
b) More Precise, Shorter History Auto-Steps (~24 intrabars) : Uses finer intrabar resolution. It is slower and provides less history. Uses an average minimum of 24 intrabars.
c) Fixed : Uses the fixed resolution of your choice.
Auto-Steps calculations vary for 24/7 and conventional markets in order to achieve the proper target of minimum intrabars.
You can choose to view the intrabar resolution currently used to calculate delta volume. It is the default.
The proper selection of the intrabar resolution is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors.
8 — Markers
Six markers are available:
1. Combined Balances Agreement : All three Bar Balances are either bullish or bearish.
2. Up or Down % Agrees With Bar : An up marker will appear when the percentage of up intrabars in an up chart bar is greater than the specified percentage. Conditions mirror to down bars.
3. Divergence confirmations By Price : One of the four types of balance calculations can be used to detect divergences with price. Confirmations occur when the bar following the divergence confirms the balance bias. Note that the divergence events used here do not include neutral intrabar events.
4. Balance Transitions : Bull/bear transitions of the selected balance.
5. Markers Bias Transitions : Bull/bear transitions of the Markers Bias.
6. Divergence Confirmations By Line : Marks points where the line first breaches a divergence level.
Markers appear when the condition is detected, without delay. Since nothing is plotted in realtime, markers do not appear on the realtime bar.
9 — Settings
• Two modes can be selected to dampen the line on the ratio of neutral intrabars.
• A distinct weight can be attributed to the count of the latter half of intrabars, on the assumption that later intrabars may be more important in determining the outcome of chart bars.
• Allows control over the periods of the different moving averages used in calculations.
• The default periods used for the various calculations define the following hierarchy from slow to fast:
Balance Averages: 50,
Balance Momentum: 20,
Dual Up/Down Averages: 20,
Marker Bias: 10.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars—which is not officially supported by TradingView.
• The method used does not work on the realtime bar—only on historical bars.
• The indicator only works on some chart resolutions: 3, 5, 10, 15 and 30 minutes, 1, 2, 4, 6, and 12 hours, 1 day, 1 week and 1 month. The script’s code can be modified to run on other resolutions, but chart resolutions must be divisible by the lower resolution used for intrabars and the stepping mechanism could require adaptation.
• When using the "Line vs Divergence Levels — Dual Color Gradient" color mode to fill the line, background or chart bars, keep in mind that a line calculation mode must be defined for it to work, as it determines gradients on the movement of the line relative to divergence levels. If the line is hidden, it will not work.
• When the difference between the chart’s resolution and the intrabar resolution is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
• Alerts do not work reliably when `security()` is used at intrabar resolutions. Accordingly, no alerts are configured in the indicator.
• The color model used in the indicator provides for fancy visuals that come at a price; when you change values in Inputs , it can take 20 seconds for the changes to materialize. Luckily, once your color setup is complete, the color model does not have a large performance impact, as in normal operation the `security()` calls will become the most important factor in determining response time. Also, once in a while a runtime error will occur when you change inputs. Just making another change will usually bring the indicator back up.
█ RAMBLINGS
Is this thing useful?
I'll let you decide. Bar Balance acts somewhat like an X-Ray on bars. The intrabars it analyzes are no secret; one can simply change the chart's resolution to see the same intrabars the indicator uses. What the indicator brings to traders is the precise count of up/down/neutral intrabars and, more importantly, the calculations it derives from them to present the information in a way that can make it easier to use in trading decisions.
How reliable is Bar Balance information?
By the same token that an up bar does not guarantee that more up bars will follow, future price movements cannot be inferred from the mere count of up/down/neutral intrabars. Price movement during any chart bar for which, let's say, 12 intrabars are analyzed, could be due to only one of those intrabars. One can thus easily see how only relying on bar balance information could be very misleading. The rationale behind Bar Balance is that when the information mined for multiple chart bars is aggregated, it can provide insight into the history behind chart bars, and thus some bias as to the strength of movements. An up chart bar where 11/12 intrabars are also up is assumed to be stronger than the same up bar where only 2/12 intrabars are up. This logic is not bulletproof, and sometimes Bar Balance will stray. Also, keep in mind that balance lines do not represent price momentum as RSI would. Bar Balance calculations have no idea where price is. Their perspective, like that of any historian, is very limited, constrained that it is to the narrow universe of up/down/neutral intrabar counts. You will thus see instances where price is moving up while Balance Momentum, for example, is moving down. When Bar Balance performs as intended, this indicates that the rally is weakening, which does necessarily imply that price will reverse. Occasionally, price will merrily continue to advance on weakening strength.
Divergences
Most of the divergence detection methods used here rely on a difference between the bias of a calculation involving a multi-bar average and a given bar's price direction. When using "Bar Balance on Bar" however, only the bar's balance and price movement are used. This is the default mode.
As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. I do not share the overwhelming enthusiasm traders have for the purported ability of bullish/bearish divergences to indicate imminent reversals.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . Bar Balance 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 Bar Balance 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.
█ NOTES
For traders
• To avoid misleading traders who don't read script descriptions, the indicator shows nothing in the realtime bar.
• The Data Window shows key values for the indicator.
• All gradients used in this indicator determine their brightness intensities using advances/declines in the signal—not their relative position in a fixed scale.
• Note that because of the way gradients are optimized internally, changing their brightness will sometimes require bringing down the value a few steps before you see an impact.
• Because this indicator does not use volume, it will work on all markets.
For coders
• For those interested in gradients, this script uses an advanced version of the Advance/Decline gradient function from the PineCoders Color Gradient (16 colors) Framework . It allows more precise control over the range, steps and min/max values of the gradients.
• 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:
— alexgrover who helped me think through the dampening method used to attenuate signal lines on high ratios of neutral intrabars.
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator . The technique I use to inspect intrabars is derived from Kuan's code.
— theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`’s behavior at intrabar resolutions.
— midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics. He is also the co-author of the PineCoders Color Gradient Frameworks .