volumeUtilitiesLibrary "volumeUtilities"
generate_and_plot_volumeProfile(length, valueArea_perc, plot_vp, show_vp_labels, include_vp_levels)
: Generate and plot volume profile
Parameters:
length (int) : (int): Length of the volume profile indicator
valueArea_perc (float) : (float): Percentage of the volume that will be in the value area
plot_vp (bool) : (bool): Flag to plot or not the indicator
show_vp_labels (bool) : (bool): Flag to plot the labels of the levels
include_vp_levels (bool) : (bool): Flag to include the values inside the labels of the levels
Returns: : Returns POC level, upper value area level, lower value area level and alerts if close is above or below the value area.
Buscar en scripts para "volume profile"
VWAP Boulevard [vnhilton](OVERVIEW)
The idea of this indicator comes from traders identifying supply to mainly look for shorts. Scenarios would be gap ups or pump & dumps where huge volume is transacted, & bag-holders are present. Some traders would draw resistance lines, I myself used to draw supply zones using the volume profile on that day, & others used the day VWAP on those days. VWAP Boulevard (I believe the name comes from the trader named team3dstocks) draws day VWAP lines from the highest volume days for a given period (excluding the current day).
(FEATURES)
- Draws horizontal & vertical lines from up to 250 highest volume days out of up to 3568 days, with the ability to hide either of these lines, their thicknesses, styles
- Extend/cut horizontal lines, or extend them all the way to the right
- Show the day VWAP, volume & age for these days in labels, with the ability to show what information you want to see only
- Separate customizable color forms for the lines & labels - ordinary (1 color); volume (2 color gradient from lowest to highest volume of the highest volume days); age (2 color gradient from youngest to oldest volume of the highest volume days)
- Edit offset & size of labels, & hide them
- Hide vertical lines
From left to right: Age color; ordinary color; volume color
250 highest volume days in the past year. Very messy so it's very likely you won't be using this but the ability to draw lines from 250 highest volume days is there if needed
(DRAWDOWNS)
- This indicator will only on the daily timeframe (error message will show up if unaware of this, & can be toggled off). Unfortunately, this would mean you would have to draw the lines manually yourself if you wish to use them on intraday timeframes.
- You may also encounter the 'Pine cannot determine the referencing length of a series. Try using max_bars_back' error. This occurs when the lookback period is very high & the indicator attempts to recalculate I believe. If this happens then reload the indicator.
The logic I used to obtain the highest volume days were to put all of the volume days in a given period in 1 array, then to sort them from highest to lowest, & also store their sorted indices in an separate array as well, so that drawings for each volume day could be done from the 2 arrays.
//Volume for last N periods
var int pastVol = array.new_int(lookbackPeriodFixed)
for i = 0 to lookbackPeriodFixed - 1
array.set(pastVol, i, int(volume ))
sortedIndices = array.sort_indices(pastVol, order.descending) //All Indices of sorted volume from highest to lowest
sortedIndices2 = array.slice(sortedIndices, 0, highestVolDays) //Indices of sorted volume from highest to lowest
array.sort(pastVol, order.descending) //All Volume sorted from highest to lowest
pastVol2 = array.slice(pastVol, 0, highestVolDays) //Volume sorted from highest to lowest
//Drawings
for i = 0 to highestVolDays - 1
index := array.get(sortedIndices, i)
vol := array.get(pastVol, i)
Since these array sizes were determined from the lookback period, it would mean that the request.security() function used to obtain daily values on intraday timeframes wouldn't work for a lookback period >20 (20 * 2 values I believe, which are the day VWAP & the day volume) as TradingView has put a maximum amount of calls of 40 in 1 script. Therefore, for intraday plots to work I would have to change the logic for getting the day VWAP & day volume for the highest days, as the request.security() function doesn't work on for loops, & this would also mean that the user would only be able to draw lines from up to 20 highest volume days instead of 250. I couldn't go forward with this as I wasn't able to find the logic to pick the highest volume days & their day VWAPs & times (indexes) without using a for loop. If anyone has any solutions (including for the 'Pine cannot determine the referencing length of a series. Try using max_bars_back' error) then please let me know. I've also left commented-out code for dealing with intraday drawings for future use.
RSI ProfileThis indicator shows the RSI profile from historical RSI Value and High / Low RSI Pivots.
It is inspired by the Volume Profile which is a common charting study that indicates activity at specified levels. It plots a histogram on the chart meant to identify dominant/significant levels.
This script is profiling RSI levels into a histogram, which can identify the crucial RSI values in the chart. Along with the pivot options that can help identify the dominant pivot points where RSI values had been rebounding historically.
How to use:
There are three profile types available in the settings. When selecting RSI Values, the indicator will count RSI values from history, and plot the count in a histogram at the end of the chart. If you select RSI Pivots High or RSI Pivots Low, the indicator will count only the RSI Pivot Highs and Lows and plot the count in a histogram. Users can select the Pivot Left/Right length from the settings.
Users can extend the POC line to the left, to study how the values had been reacting to POC
Please note: Since the RSi values range from 0 to 100, the indicator is rounding off the values to absolute numbers. This can cause a situation where multiple POC are identified, to find the unique POC, you can increase the width of the histogram.
The Max/Min RSI settings are for visual purposes only, it can help users shrink down the histogram's top and bottom visibility
WMACDThis is MACD but little different.
The idea behind this is to use MACD to find resistance and support level first. So we can use the logic of volume profiles for this setting and by imply the MACD on it you can make the hybrid for it .
The line represent the both resistance level and if macd is above or bellow the zero
if line is red the macd is bellow zero if it lime then it above zero .
The bars represent the macd (in gray) - left side is buy and right side is sell
so how to use it ?
for example : if MACD is red and price is bellow the line we are in bear state and the line represent the resistance
lets say price bellow the line and macd line is green then this is buy signal and our goal is to reach the price of the supposed resistance
, if price break the line up then we are in bull time mode and strong buy .
Now our line will become the support line .
you can change the setting of the MACD to make it more sensitive or less sensitive as regular macd with fast and slow length
This is a concept idea how to make the MACD to find resistance and support level
so try to play with it to see how it work
Volume Spikes & Growing Volume Signals With Alerts & ScannerVOLUME SPIKES & GROWING VOLUME SIGNALS WITH ALERTS & SCANNER
This indicator shows arrows when there is a volume spike. It also paints the background when volume is growing. There is also a volume scanner for 8 tickers that will change color in real time when your other favorite tickers see volume growth and spikes.
You can customize the length of DMI, the number of bars to calculate the current volume average from, the number of bars back to get the overall volume average from, the multiple that needs to be hit to give a signal, the position of the scanner table and which tickers are used in the scanner. There are detailed directions as tooltips in the indicator settings you can read to understand exactly what each input does.
All features are customizable as well as which tickers the screener uses.
***HOW TO USE***
Watch for volume to pick up before placing trades as this will help you stay out of the markets when price is choppy. Volume usually brings volatility so watch for the volume signals to show up on the chart. Typically when price has made a big move one direction or is consolidating and you see the volume indicator start giving signals, the market is ready to reverse or continue its current trend but move faster in that direction.
Volume Spikes
When there is a volume spike that is larger than the average of volume over the last 100+ bars(depending on your settings) multiplied by the volume amount multiplier(in your settings) then an arrow will show up on the chart. This arrow will be green if DMI is bullish and red if DMI is bearish.
Volume Growth
A Background color will appear when the average volume over the last 5 bars(depending on your settings) is higher than the average volume over the last 100+ bars(depending on your settings) and is greater than your multiple. It will also paint the background when the volume moving average has increased over the last 3 bars consecutively. The background colors will be red or green depending on buy & sell pressure(DMI). If the background color appears, then you know volume is growing and volatility is near.
Volume Scanner
The scanner can be customized to have all of your favorite tickers by changing the tickers used in the indicator settings at the bottom. When no volume growth or spikes are detected, the ticker will show as light blue. When volume spikes or growth is detected, the ticker will turn orange to notify you.
Alerts
You can set up alerts as well when there is volume growth, bullish volume spikes and bearish volume spikes on any chart or timeframe.
Indicator Settings
Settings will need to be adjusted across different tickers as some have large swings in volume and some stay pretty even, so make sure to set up different chart layouts with settings that work for each ticker and save them individually so you don’t have to reset these values every time you switch charts.
***MARKETS***
This indicator can be used as a signal on all markets, including stocks, crypto, futures and forex as long as Tradingview has volume and DMI data for that ticker.
***TIMEFRAMES***
This volume spike indicator can be used on all timeframes as long as there is enough data for Tradingview to use for calculations.
***TIPS***
Try using numerous indicators of ours on your chart so you can instantly see the bullish or bearish trend of multiple indicators in real time without having to analyze the data. Some of our favorites are our Auto Fibonacci, Volume Profile, Momentum, Auto Support And Resistance and Money Flow Index in combination with this Volume Growth indicator. They all have real time Bullish and Bearish labels as well so you can immediately understand each indicator's trend.
Market Profile with TPOThis is is Market Profile with TPO (the letters) on the current session. Due to pinescript limitations, we are limited to 500 TPOs, since this script uses 1 label per TPO. It is NOT volume profile, this is Time Profile (Time spent at a price).
Z-HistogramIt is possible to approximate the underlying distribution of a random variable by using what is called an "Histogram". In order to construct an histogram one must first split the data into several intervals (also called bins) often of the same size and count the number of values falling within each intervals, the histogram plot is then constructed with the X axis representing the measured variable and the Y axis representing the frequency.
The proposed script aim to estimate the underlying distribution of a rolling z-score by constructing its histogram, here the histogram consist of 13 bins of width 0.5 rolling standard deviations. The length setting define the rolling z-score period, the window setting define the number of past data to be counted, finally using the "Total" option (true by default) will count all the rolling z-scores values since the first bar, in order to use the window setting make sure to uncheck the "Total" option.
DISPLAY
In order to see the entirety of the histogram make sure to double click on the indicator window and to have all the lower panels (text notes, pine editor...etc) hidden, finally make sure to zoom-in in order to see the frequency numbers displayed.
Z-Histogram on BTCUSD 15 min TF, the blue bins represent intervals situated over 0 while red bins represent intervals situated under 0. Here σ represent the X-axis in standard deviations, the histogram start with a bin situated at σ = -3 which count the number of times the rolling z-score was within -3 and -2.5, the histogram end with the bin situated at σ = 3 which count the number of time the rolling z-score was within 3 and 3.5.
It is also possible to look at the shape of the histogram without having the indicator window at full size.
INTERPREATION
An histogram can give really interesting information such as overall trend direction and strength. The direction can be measured by looking at the skewness of the histogram, with a negative skewness (the peak of the histogram situated at the right from the center) representing down-trending variations and positive skewness (the peak of the histogram situated at the left from the center) representing up-trending variations, while a symmetrical histogram could represent a ranging market. The farther away the peak of the histogram is situated from the center, the stronger the trend.
Another interesting characteristic is the tailedness of the histogram, which can give information about the cleanliness of the trend, for example a positive skew and high tailedness would represent a clean up-trend, as it could suggest less variations contrary to the main trend.
An histogram applied to the rolling z-score can give various useful information. As a recall the rolling z-score of the price measure the distance between the closing price and its moving average in term of rolling standard deviations, for example if the rolling z-score is equal to 2 it means that the closing price is currently 2 rolling standard deviations over its moving average.
Lets for example analyze the histogram using INTC 15 min tf with a window of 456 bars and rolling z-score of length = 100 in order to review longer term variations.
We can see from the histogram that the uptrend visible on the chart is represented by the bins situated over 0 having an overall higher frequency than the bins under 0, we can see that the closing price tended to stay between 1 and 1.5 rolling standard deviations over its period 100 moving average. Here bins under 0 accounts for retracements in the trend.
IN SUMMARY
An histogram can give various information regarding the price evolution of a security, the proposed script aim to plot the histogram of a rolling z-score. Now this script might not be too useful but it was fun to make, also it does not mean that an histogram is not an useful tool in the context of trading, the only thing required is a god implementation of it (like volume profiles for example)
In this post we have also reviewed some important statistical concepts such as distributions, z-score, skewness and tailedness, each being extremely important in the quantitative trading field.
Thx for reading !
Patient Trendfollower (7)(alpha) Backtesting AlgorithmThis is an alpha version of backtesting algorithm for my Patient Trendfollower (7) strategy. It can help you adapt the indicator to other charts than EURUSD. Please bear in mind that price action, volume profiles and supzistences are a catalyst for successful trading, not an indicator. You can get significantly better results if you use these things in your trading and use Trendfollower only as a secondary tool.
Patient Trendfollower Indicator
Thanks belongs to @everget and Satik FX, their contributions are highlighted on an indicator page.
Delta Volume Columns [LucF]Displays delta volume columns using intrabar volume information. Each volume column is divided into three sections: buying, selling and neutral volume. Volume for each section is determined from the volume and price movement of each intrabar at a user-selected lower resolution.
Features include:
- Choice of color themes for either dark or light chart backgrounds
- Delta volume columns
- Volume Balance displayed as the difference between the MAs of buying and selling volume
- Display of divergences between a bar’s volume balance and the bar’s price movement (example: buying volume > selling volume but close < open). Divergences can be shown in 2 different color schemes (including green/red showing a tentative direction), on volume columns and/or on chart bars
- Display of bar by bar volume balance with highlighting of above average volume
- Display of the usual total volume MA
- Choice of the lower resolution used to retrieve intrabar information
- Alerts configurable on any combination of the markers, with control over long/short direction
- Choice of 3 different markers:
1. Double bumps: two consecutive bars where buying or selling volume is in the same direction and where volume > volume MA
2. Divergence confirmations: direction of the price bar following a price/volume balance divergence
3. Volume balance shifts: zero level crossings of the volume balance MA delta
The chart shows the two main modes of display:
- Top pane : shows the stacked volume columns with divergences in orange and the flattened volume balance MAs delta at the bottom of the volume columns. This volume balance is the same shown in the bottom pane. The top pane also shows the instant volume balance strip above the volume columns. The strip’s colors show which of the buying or selling volume was greater, and colors are brighter if the total volume was above the total volume MA.
- Bottom pane : shows the volume balance MAs delta with markers 1 and 2. Given that this graphic has no price momentum component, I find quite eerie how it often looks like a momentum-based signal.
The default 5 minute intrabar resolution is used in combination with the weekly chart, which is excessive.
This script uses a special characteristic of the security() function’s behavior when it is sent to a resolution lower than the chart’s resolution. Details are given in the script’s comments. This method has the advantage of working under more circumstances than some of the other loop-based methods, but it also has its limits.
IMPORTANT
This is what you need to know:
- The method used does not work on the realtime bar—only on historical bars. Consequently, the volume column shown on the realtime bar is a normal volume column plotted in green or red, following price movement. The column will only show delta volume information after it closes and becomes a historical bar.
- The indicator only works on some chart resolutions: 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.
- Intrabar resolutions can be selected from 1, 5, 15, 30, 45 minutes, 1, 2, 3, 4 hours, 1 day, 1 week and 1 month. The intrabar resolution must of course be smaller than the chart’s resolution.
- Contrary to my other indicators where alerts must be configured to trigger “Once Per Bar Close” in order to avoid false triggers (or repainting), all this indicator’s alerts are designed to trigger using previous bar information since the indicator’s calculations in the realtime bar are not exact. Markers are not plotted with a negative offset; they appear at the beginning of the realtime bar following confirmation of the marker’s condition on the previous bar. Alerts for this indicator should thus be configured to trigger “Once Per Bar” so they trigger at the beginning of the realtime bar. Note that the penalty is not that great, as it is simply the instant between the close of the previous realtime bar and the opening of the next. The advantage of using this technique is that the indicator does not repaint; a marker that appears at the beginning of the realtime bar will never disappear.
- The script only plots information that is reliable in the realtime bar, i.e., total volume and markers. All other plots are set to n/a to prevent misleading traders.
- When the difference between the chart’s resolution and the lower resolution is too important, volume columns will not calculate for all bars in the dataset.
On Delta Volume
Buying or selling volume are misnomers, as every unit of volume transacted is both bought and sold by 2 different traders. There is no such thing as “buy only” or “sell only” volume, but trader lingo is riddled with original fabulations.
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. The built-in volume indicator available on TradingView uses this logic to color the volume columns green or red. While this script’s numbers are more precise because it analyses a number of intrabars to calculate its information, it uses the exact same imperfect logic to calculate its buying/selling/neutral sections.
Until Pine scripts can have access to how much volume was transacted at the bid/ask prices, our so-called buying/selling volume information will always be a mere proxy.
Divergences
You may wonder how there can be divergences between buying/selling volume information and price movement. This will sometimes be due to the methodology’s shortcomings we have just discussed, 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. I do not share the overwhelming enthusiasm traders have for divergences. To your pattern-hungry brain, the orange bars this indicator shows on chart will—as divergences on other indicators do–appear to often indicate turnarounds. My opinion is that reality is generally quite sobering, as many who have tried building automated rules based on divergences will tell you. I do not have hard numbers on the lack of performance of divergences—only many failed attempts to make them perform, which a few experienced strategy modelers I know share with me. Please don’t try to read too much into them. While they look great on past data, I find they are often difficult to use in realtime to make bets with good odds.
Thanks to:
- A guy called Kuan who commented on a Backtest Rookies presentation of an intrabar delta volume indicator using a for loop. The heart of “my” indicator is code borrowed from Kuan; I just built a hopefully useful wrapper around it.
- @theheirophant, my partner in the exploration of the sometimes weird abysses of security() ’s behavior at lower resolutions.
moving quantilesAlways works... Just kidding, indicates moving quantiles. Something between volume profiles and moving averages.
MultiTFlevels with Volume Display1. Overview
This indicator is intended for use on trading platforms like TradingView and provides the following features:
Volume Profile Analysis:
Shows cumulative volume delta (CVD) and displays buying and selling volumes.
Historical OHLC Levels:
Plots historical open, high, low, and close levels for various timeframes (e.g., daily, weekly, monthly).
Customizable Settings:
Allows users to toggle different elements and customize display options.
2. Inputs
Timeframe Display Toggles:
Users can choose to display OHLC levels from different timeframes such as previous month, week, day, 4H, 1H, 30M, 15M, and 5M.
CVD Display Toggle: Option to show or hide the Cumulative Volume Delta (CVD).
Line and Label Customization:
leftOffset and rightOffset: Define how far lines are extended left and right from the current bar.
colorMonth, colorWeek, etc.: Customize colors for different timeframe OHLC levels.
labelOffset and rightOffset: Control the positioning of volume labels.
3. Key Features
Cumulative Volume Delta (CVD)
Calculation:
Computes the cumulative volume delta by adding or subtracting the volume based on whether the close price is higher or lower than the open price.
Display:
Shows a label on the chart indicating the current CVD value and whether the market is leaning towards buying or selling.
Historical OHLC Levels
Data Retrieval:
Uses the request.security function to fetch OHLC data from different timeframes (e.g., monthly, weekly, daily).
Plotting:
Draws lines and labels on the chart to represent open, high, low, and close levels for each selected timeframe.
Buying and Selling Volumes
Calculation:
Calculates buying and selling volumes based on whether the close price is higher or lower than the open price.
Display:
Shows labels on the chart for buying and selling volumes.
4. Functions
getOHLC(timeframe)
Retrieves open, high, low, and close values from the specified timeframe.
plotOHLC(show, open, high, low, close, col, prefix)
Draws OHLC lines and labels on the chart for the given timeframe and color.
5. Usage
Chart Overlay: The indicator is overlaid on the main chart (i.e., it appears directly on the price chart).
Historical Analysis:
Useful for analyzing historical price levels and volume dynamics across different timeframes.
Volume Insights:
Helps traders understand the cumulative volume behavior and market sentiment through the CVD and volume labels.
In essence, this indicator provides a comprehensive view of historical price levels across multiple timeframes and the dynamics of market volume through CVD and volume labels. It can be particularly useful for traders looking to combine price action with volume analysis for a more in-depth market assessment.
PVSRA Candles Auto OverrideWhat does this “PVSRA Candles Auto Override” Indicator
do?
This indicator automates PVSRA analysis for crypto traders. It finds the corresponding Binance Perpetual Futures chart for the current instrument, then replaces the current chart's volume profile with the perpetual futures data (if available) to ensure the PVSRA calculation uses the most relevant volume. This not only reduces human error during market scans but also automatically selects the appropriate Binance Perpetual Futures contract, saving time and improving the accuracy of PVSRA calculations.
How can a trader use this indicator?
This helps the trader to identify if there is volume data available in an equivalent Binance Perpetual Futures chart and automatically displays it, making it easier to switch coins whilst viewing the market. Why do we want to use Binance Perpetual Futures Volume? In most markets Binance volume surpasses those of other crypto exchanges so this will give us a better view on the volume spikes in the market.
What is PVSRA and how can I trade using this indicator?
PVSRA candles are a type of candlestick chart formatting. PVSRA stands for Price, Volume, Support and Resistance Analysis.
Here's a breakdown of what PVSRA candles aim to achieve:
Combine multiple factors: They take into account price movement, trading volume, and support and resistance levels to identify potential trading opportunities.
Highlight potential imbalances: By color-coding candles based on PVSRA analysis, they aim to show areas of high volume activity, potentially representing imbalances created by market makers (large institutions that influence price).
Identify areas of revisit: The theory is that these high-volume zones may be revisited by the market in the future, as there's "unrecovered liquidity" in those areas.
Usage of the Indicator:
By default the indicator will automatically use the Equivalent Binance Perpetual Chart for the Data
You can override the symbol manually if you what to view another instrument’s data.
POC IndicatorThis simplified Point of Control (POC) indicator for TradingView is designed to identify and plot the price level where the highest volume of trading occurred over a specified period. The script works as follows:
Input and Initialization: The user specifies a length for the analysis period. Variables highestVolPrice and highestVol are initialized to track the price with the highest volume and the highest volume encountered, respectively.
Volume Analysis Loop: For each bar in the specified period (up to length bars back from the current bar), the script compares the volume of the current bar (volume ) to highestVol. If the current bar's volume is higher, highestVol and highestVolPrice are updated to reflect the volume and closing price of the current bar.
Plotting the POC: Instead of using a horizontal line (hline), which cannot be dynamically updated within the loop, the script uses plot to draw the POC. This plotting function draws a line on the chart that represents the closing price level associated with the highest volume observed within the analysis period.
Resetting Variables: To ensure the indicator updates correctly with each new bar, the script resets highestVol and highestVolPrice at the start of the analysis for each new period. This step is designed to recalculate the POC dynamically as new data comes in.
This approach offers a basic method for visualizing significant price levels where substantial trading activity occurred, potentially indicating areas of strong support or resistance. However, it's a simplified model and does not calculate the true POC based on a detailed volume profile across all price levels within the period.
Heat profileA trader once told me that top wicks equals sell interest and bottom wicks equals buy interest. If that's true then this indicator tries to organize and visualize this idea.
It uses transparent boxes to give the impression of a heat map. Due to limitations of my own skill and possibly pinescript it is not possible to render it in a useful manner using different colors that depicts buy and sell interests respectively. This means it works more like a volume profile in that it mixes the buy and sell interest together in the heat map. This can still be helpful because it help traders focus their attention on areas other than the current price candle.
In my limited time of using it, it seems like on the large timeframes the highlighted areas is where the price wants to go, and on small time frames the darkest areas is where the price wants to go. But i will leave it up to any user to spot and use their own patterns with the indicator.
Last but not least, the indicator only uses the last 50 candles, which can be too little on a small timeframe. Unfortunately the way i have done it this limitation is hardcoded in the script due to how pinescript works, by editing the code you can increase it. (Put max_boxes_count = x after overlay = true. Maximum number is 500)
Hope you enjoy. Have a nice day.
Balance Zone ExtensionBalance zones are an aspect of trading that many traders notice. Balance Zones are formed when a market is in equilibrium and respects a certain high and low multiple times. These zones could also be called accumulation or distribution areas depending on the price action. If the term "choppy" is used to describe a given markets price action, it is probably a fair statement to say that the market is currently in a Balance Zone.
This script is a take on vwaptrader1's teachings where you take a balance zone and "double it" to get a target if/when it does break out of balance. It provides an automated way of extending levels based on a given balance range.
The lines plotted by the script are calculated based off of the balance high/low inputs, how many sections are desired per zone, and how many boxes to plot based on the other user inputs.
Warning: Due to a current limitation of the Pine, this script is only allowed to plot up to 500 lines total. If you start to notice lines starting to disappear or you begin getting a script error, double check the input settings as the script may have crossed the 500 line threshold.
This can be used in conjunction with Fixed Range Volume Profile . Select the balance range with the Fixed Volume Profile . Note the Value Area High and Value Area Low prices and input those into the balance range High/Low inputs.
Use to create price targets from Balance Zone Breakouts
A recent example of this idea in action on ticker ES1! 2 hour chart where the balance range was found and the target (double the box size of the balance range) was hit.
Another example of this same concept but on a normal security like AAPL but on a 30 minute chart:
Extending the usefulness even further to crypto on BTCUSD with a 5 minute chart:
Use to create reference levels for future price action
The other way to utilize this is to provide future reference levels from a key balance range from the past.
Here is another example utilizing the AMD daily chart . First, a balance zone was noted for all of 2017:
Moving forward to the most recent price action in 2023, notice that the box extension levels are still fairly well respected almost 6 years later!
Fr3d0's Volume Profile Visible RangeLow level implementation
At the core of VPVR there’s a concept called “bucketization”.
Question : what is bucketization?
Answer : bucketization consists of identifying metrics with high predictive power and combine them appropriately.
I think this is a problem of bucketization because what the VPVR does is to take a price range, divide it into buckets and fill them up with the volume that was produced in each bucket’s range over the given period.
The more we divide our price range the finer the resolution, but also the less significant each bucket will become.
The steps are :
1. Get the price range with min and max over the give period;
2. Divide the range into buckets;
3. Loop over each candle of the given period and proportionally assign volume to one or more bucket.
Question : how to assign volume to buckets?
Answer : we need to calculate the right amount to add to each bucket for each candle. If 20% of a candle lies on a bucket then that bucket needs to have 20% of the volume of that candle, the rest 80% belongs to other buckets.
To get the percentage of a candle on a given bucket we have to find the price range of the candle contained within the bucket, then divide that amount by the entire length of the candle.
How to bucketize
Question : what are the formulas of A, B, C and Target respectively?
Answer :
- A = Max(candle_high, bucket_top) - Min(candle_low, bucket_bottom);
- B = Max(candle_high, bucket_top) - Min(candle_high, bucket_top);
- C = Max(candle_low, bucket_bottom) - Min(candle_low, bucket_bottom);
- Target = A - B - C.
Now that we now how to calculate the price range belonging to each bucket we need to calculate a percentage of volume to fill the bucket with.
The formula is trivially simple :
Volume * Target / (candle_high - candle_low).
Question : can we distinguish between buy volume and sell volume? If so, how?
Answer : yes we can and the following paragraph will teach you how.
Put it simply we can use the difference between the extremes of a candle (low and high) and its close price to get the buy and sell volumes.
The formulas for that are :
- Buy volume = Volume * (close - low) / (high - low);
- Sell volume = Volume * (high - close) / (high - low).
I know this is rather simplicistic but it makes sense.
Closing thoughts
This script is a working progress and I’m going to give more details if necessary, just let me know in the comments down below.
[francrypto® strategy] 4 EMAs, P.SAR & Vol.Prof. (by kv4coins)(ENG)
This script consists of my own strategy for cryptocurrency (but can be adapted very well for stocks, forex, etc.)
Is a combination of:
- Four Exponentials Moving Average (EMA), configurables: by defect are 10, 21, 55 and 200 periods in yellow, aqua, orange and blue each of them
- Parabolic SAR System (PSAR), configurable
- Volume Profile (that has been developed by kv4coins - he has already authorized me to use it under the same OSS Licence Terms: MPL 2.0), configurable: with another default values and bilingual support for Spanish (SPA)
How it works
1) It is always better to detect specifics candlesticks or patrons: doji , pinbar or inverted pinbar , engulfing bars , morning star or evening star , harami , twizzer bottom or top , etc.
2) The 10 and 21 periods EMA help to identify the short-term behavior
3) The 55 periods EMA can be used like a support or resistance in medium-term, as 200 periods EMA in very long-term
4) It will convenient search for a double cross (10 & 21) or a triple cross (10, 21 & 55) to determine the medium-term change Downtrend to UpTrend (or viceversa)
5) Confirm the change patron with the Parabolic SAR and then identify potencials purchases or sales
6) Use Volume profile to detect potential supports or resistances areas, in order to set stop limit/loss and take profit orders.
Hope this helps!
Cheers,
FRANCRYPTO®
–––––– 0 ––––––
(ESP)
Este script consiste en mi propia estrategia para criptomonedas (pero puede adaptarse muy bien para acciones, forex, etc.)
Es la combinación de:
1) Cuatro Medias Móviles Exponenciales (EMA), configurables: por defecto son de 10, 21, 55 y 200 períodos en amarillo, turquesa, naranja y azul cada una de ellas
2) Sistema Parabolic SAR (PSAR), configurable
3) Perfil de Volumen (que fuera desarrollado por kv4coins - que ya me ha autorizado a su uso bajo las mismas condiciones de la Licencia OSS: MPL 2.0), configurable: con otros valores por defecto y soporte bilingüe para Español (SPA)
Cómo funciona
1) Siempre va a resultar mejor detectar velas japonesas específicas o patrones: doji , martillos o martillos invertidos , velas envolventes , patrón amanecer o atardecer , harami , velas gemelas , etcétera
2) La EMA de 10 y 21 períodos ayudan a identificar el comportamiento de corto plazo
3) La EMA de 55 períodos puede ser usada como un soporte o resistencia de mediano plazo, como así también, la EMA de 200 períodos en el muy largo plazo
4) Será conveniente buscar un doble cruce (10 & 21) o un triple cruce (10, 21 & 55) para determinar un cambio de la tendencia de mediano plazo de bajista hacia alcista (o viceversa)
5) Confirmá el patrón de cambio con la Parabólica de SAR y entonces identificá potenciales compras o ventas
6) Usá el perfil de volumen para detectar las potenciales zonas de soporte o resistencia, principalmente para establecer ordenes stop limit/loss o take profit.
¡Espero que pueda serles de utilidad!
Saludos,
FRANCRYPTO®
[R&D] Moving CentroidThis script utilizes this concept. Instead of weighting by volume, it weights by amount of price action on every close price of the rolling window. I assume it can be used as an additional reference point for price mode and price antimode.
it is directly connected with Market (not volume) profile, or TPO charts.
The algorithm:
1) takes a rolling window of, for example, 50 data points of close prices:
2) for each of this closing prices, the algorithm will check how many bars touched this close price.
3) then: sum of datapoints * weights/sum of weights
Since the logic is implemented in pretty non-efficient way, the script sometimes can take time to make calculations. Moreover, it calculates the centroid taking into account only close prices, not every tick. of a given rolling window That's why it's still experimental.
Price Action UltimateThe Price Action Ultimate indicator is an innovative tool designed to provide traders with a comprehensive view of price action based on either volume or touches. By default, the indicator displays touches, offering a unique perspective on price levels that have been frequently interacted with by the market.
At its core, the indicator divides the price range of a specified lookback period into a number of rows (default 25). For each row, it calculates either the volume traded or the number of times the price touched that level. This data is then visualized in two ways: as a histogram and as horizontal lines on the chart.
The histogram, displayed on the right side of the chart, represents the distribution of touches (or volume) across different price levels. Each bar in the histogram shows the number of touches and the percentage of total touches for that price level. The color of the bars ranges from a user-defined low activity color to a high activity color, providing a quick visual reference for the most active price levels.
The horizontal lines drawn across the chart represent the most significant levels based on touches (or volume). By default, the indicator displays the top 3 levels, but this can be adjusted. The thickness of these lines corresponds to the relative importance of each level - thicker lines indicate more touches or higher volume. This feature allows traders to quickly identify key support and resistance levels based on historical price action.
One of the most innovative aspects of this indicator is the option to fade older levels over time. When enabled, this feature gradually increases the transparency of lines as they age, with newer levels appearing more prominently. This helps traders focus on the most recent and relevant price action while still maintaining awareness of older, potentially significant levels.
The indicator offers flexibility in its display options. Users can choose to show levels based on volume, touches, or both. This allows traders to compare and contrast different perspectives on price action. Additionally, the indicator includes options to display a volume profile and a background fill for the analysis range, further enhancing its visual appeal and informational content.
What makes this indicator particularly valuable is its ability to provide a clear, uncluttered view of key price levels without relying on complex calculations or multiple indicators. It distills price action down to its essence - where price has spent the most time or where the most trading activity has occurred. This can be incredibly useful for identifying potential support and resistance levels, areas of consolidation, or possible breakout points.
For traders focused on price action strategies, this indicator offers a powerful tool to enhance their analysis. It provides a data-driven approach to identifying significant price levels, which can be used to inform entry and exit decisions, set stop losses, or anticipate potential market reactions.
This indicator is a tool to aid in market analysis and should not be used as the sole basis for trading decisions. Always combine multiple forms of analysis and practice proper risk management when trading. Past performance does not guarantee future results.
Uptrick: Market MoodsThe "Uptrick: Market Moods" indicator is an advanced technical analysis tool designed for the TradingView platform. It combines three powerful indicators—Relative Strength Index (RSI), Average True Range (ATR), and Bollinger Bands—into one cohesive framework, aimed at helping traders better understand and interpret market sentiment. By capturing shifts in the emotional climate of the market, it provides a holistic view of market conditions, which can range from calm to stressed or even highly excited. This multi-dimensional analysis tool stands apart from traditional single-indicator approaches by offering a more complete picture of market dynamics, making it a valuable resource for traders looking to anticipate and react to changes in market behavior.
The RSI in the "Uptrick: Market Moods" indicator is used to measure momentum. RSI is an essential component of many technical analysis strategies, and in this tool, it is used to identify potential market extremes. When RSI values are high, they indicate an overbought condition, meaning the market may be approaching a peak. Conversely, low RSI values suggest an oversold condition, signaling that the market could be nearing a bottom. These extremes provide crucial clues about shifts in market sentiment, helping traders gauge whether the current emotional state of the market is likely to result in a reversal. This understanding is pivotal in predicting whether the market is transitioning from calm to stressed or from excited to overbought.
The Average True Range adds another layer to this analysis by offering insights into market volatility. Volatility is a key factor in understanding the mood of the market, as periods of high volatility often reflect high levels of excitement or stress, while low volatility typically indicates a calm, steady market. ATR is calculated based on the range of price movements over a given period, and the higher the value, the more volatile the market is. The "Uptrick: Market Moods" indicator uses ATR to dynamically gauge volatility levels, helping traders understand whether the market is currently moving in a way that aligns with its emotional mood. For example, an increase in ATR accompanied by an RSI value that indicates overbought conditions could suggest that the market is in a highly excited state, with the potential for either strong momentum continuation or a sharp reversal.
Bollinger Bands complement these tools by providing visual cues about price volatility and the range within which the market is likely to move. Bollinger Bands plot two standard deviations away from a simple moving average of the price. This banding technique helps traders visualize how far the price is likely to deviate from its average over a certain period. The "Uptrick: Market Moods" indicator uses Bollinger Bands to establish price boundaries and identify breakout conditions. When prices break above the upper band or below the lower band, it often signals that the market is either highly stressed or excited. This breakout condition serves as a visual representation of the market mood, alerting traders to moments when prices are moving beyond typical ranges and when significant emotional shifts are occurring in the market.
Technically, the "Uptrick: Market Moods" indicator has been developed using TradingView’s Pine Script language, a highly efficient language for building custom indicators. It employs functions like ta.rsi, ta.atr, and ta.sma to perform the necessary calculations. The use of these built-in functions ensures that the calculations are both accurate and efficient, allowing the indicator to operate in real-time without lagging, even in volatile market conditions. The ta.rsi function is used to compute the Relative Strength Index, while ta.atr calculates the Average True Range, and ta.sma is used to smooth out price data for the Bollinger Bands. These functions are applied dynamically within the script, allowing the "Uptrick: Market Moods" indicator to respond to changes in market conditions in real time.
The user interface of the "Uptrick: Market Moods" indicator is designed to provide a visually intuitive experience. The market mood is color-coded on the chart, making it easy for traders to identify whether the market is calm, stressed, or excited at a glance. This feature is especially useful for traders who need to make quick decisions in fast-moving markets. Additionally, the indicator includes an interactive table that updates in real-time, showing the most recent mood state and its frequency. This provides valuable statistical insights into market behavior over specific time frames, helping traders track the dominant emotional state of the market. Whether the market is in a prolonged calm state or rapidly transitioning through moods, this real-time feedback offers actionable data that can help traders adjust their strategies accordingly.
The RSI component of the "Uptrick: Market Moods" indicator helps detect the speed and direction of price movements, offering insight into whether the market is approaching extreme conditions. By providing signals based on overbought and oversold levels, the RSI helps traders decide whether to enter or exit positions. The ATR element acts as a volatility gauge, dynamically adjusting traders’ expectations in response to changes in market volatility. Meanwhile, the Bollinger Bands help identify trends and potential breakout conditions, serving as an additional confirmation tool that highlights when the price has moved beyond normal boundaries, indicating heightened market excitement or stress.
Despite the robust capabilities of the "Uptrick: Market Moods" indicator, it does have limitations. In markets affected by sudden shifts, such as those driven by major news events or external economic factors, the indicator’s performance may not always be reliable. These external factors can cause rapid mood swings that are difficult for any technical analysis tool to fully anticipate. Additionally, the indicator’s complexity may pose a learning curve for novice traders, particularly those who are unfamiliar with the concepts of RSI, ATR, and Bollinger Bands. However, with practice, traders can become proficient in using the tool to its full potential, leveraging the insights it provides to better navigate market shifts.
For traders seeking a deeper understanding of market sentiment, the "Uptrick: Market Moods" indicator is an invaluable resource. It is recommended for those dealing with medium to high volatility instruments, where understanding emotional shifts can offer a strategic advantage. While it can be used on its own, integrating it with other forms of analysis, such as fundamental analysis and additional technical indicators, can enhance its effectiveness. By confirming signals with other tools, traders can reduce the likelihood of false signals and improve their overall trading strategy.
To further enhance the accuracy of the "Uptrick: Market Moods" indicator, it can be integrated with volume-based tools like Volume Profile or On-Balance Volume (OBV). This combination allows traders to confirm the moods identified by the indicator with volume data, providing additional confirmation of market sentiment. For example, when the market is in an excited mood, an increase in trading volume could reinforce the reliability of that signal. Conversely, if the market is stressed but volume remains low, traders may want to proceed with caution. Using multiple indicators together creates a more comprehensive trading approach, helping traders better manage risk and make informed decisions based on multiple data points.
In conclusion, the "Uptrick: Market Moods" indicator is a powerful and unique addition to the suite of technical analysis tools available on TradingView. It provides traders with a multi-dimensional view of market sentiment by combining the analytical strengths of RSI, ATR, and Bollinger Bands into a single tool. Its ability to capture and interpret the emotional mood of the market makes it an essential tool for traders seeking to gain an edge in understanding market behavior. While the indicator has certain limitations, particularly in rapidly shifting markets, its ability to provide real-time insights into market sentiment is a valuable asset for traders of all experience levels. Used in conjunction with other tools and sound trading practices, the "Uptrick: Market Moods" indicator offers a comprehensive solution for navigating the complexities of financial markets.
nPOC Levels by Tyler### Explanation of the Pine Script
This Pine Script identifies and displays weekly naked Points of Control (nPOCs) on a TradingView chart. An nPOC represents a Point of Control (POC) from a previous week that has not been revisited by price action in subsequent weeks. These nPOCs are extended to the right as horizontal lines, indicating potential support or resistance levels.
#### Script Overview
1. **Indicator Declaration:**
```pinescript
//@version=5
indicator("Weekly nPOCs", overlay=true)
```
- The script is defined as a version 5 Pine Script.
- The `indicator` function sets the script's name ("Weekly nPOCs") and specifies that the indicator should be overlaid on the price chart (`overlay=true`).
2. **Function to Calculate POC:**
```pinescript
f_poc(_hl2, _vol) =>
var float vol_profile = na
if (na(vol_profile))
vol_profile := array.new_float(100, 0.0)
_bin_size = (high - low) / 100
for i = 0 to 99
if _hl2 >= low + i * _bin_size and _hl2 < low + (i + 1) * _bin_size
array.set(vol_profile, i, array.get(vol_profile, i) + _vol)
max_volume = array.max(vol_profile)
poc_index = array.indexof(vol_profile, max_volume)
poc_price = low + poc_index * _bin_size + _bin_size / 2
poc_price
```
- The function `f_poc` calculates the Point of Control (POC) for a given period.
- It takes two parameters: `_hl2` (the average of the high and low prices) and `_vol` (volume).
- A volume profile array (`vol_profile`) is initialized to store volume data across different price bins.
- The price range between the high and low is divided into 100 bins (`_bin_size`).
- The function iterates over each bin, accumulating the volumes for prices within each bin.
- The bin with the maximum volume is identified as the POC (`poc_price`).
3. **Variables to Store Weekly Data:**
```pinescript
var float poc = na
var float prev_poc = na
var line poc_lines = na
if na(poc_lines)
poc_lines := array.new_line(0)
```
- `poc` stores the current week's POC.
- `prev_poc` stores the previous week's POC.
- `poc_lines` is an array to store lines representing nPOCs. The array is initialized if it is `na` (not initialized).
4. **Calculate Weekly POC:**
```pinescript
is_new_week = ta.change(time('W')) != 0
if (is_new_week)
prev_poc := poc
poc := f_poc(hl2, volume)
if not na(prev_poc)
line new_poc_line = line.new(x1=bar_index, y1=prev_poc, x2=bar_index + 100, y2=prev_poc, color=color.red, width=2)
label.new(x=bar_index, y=prev_poc, text="nPOC", style=label.style_label_down, color=color.red, textcolor=color.white)
array.push(poc_lines, new_poc_line)
```
- `is_new_week` checks if the current bar is the start of a new week using the `ta.change(time('W'))` function.
- If it's a new week, the previous week's POC is stored in `prev_poc`, and the current week's POC is calculated using `f_poc`.
- If `prev_poc` is not `na`, a new line (`new_poc_line`) representing the nPOC is created, extending it to the right (for 100 bars).
- A label is created at the `prev_poc` level, marking it as "nPOC".
- The new line is added to the `poc_lines` array.
5. **Remove Old Lines:**
```pinescript
if array.size(poc_lines) > 52
line.delete(array.shift(poc_lines))
```
- This section ensures that only the last 52 weeks of nPOCs are kept to avoid cluttering the chart.
- If the `poc_lines` array contains more than 52 lines, the oldest line is deleted using `array.shift`.
6. **Plot the Current Week's POC as a Reference:**
```pinescript
plot(poc, title="Current Weekly POC", color=color.blue, linewidth=2, style=plot.style_line)
```
- The current week's POC is plotted as a blue line on the chart for reference.
#### Summary
This script calculates and identifies weekly Points of Control (POCs) and marks them as nPOCs if they remain untouched by subsequent price action. These nPOCs are displayed as horizontal lines extending to the right, providing traders with potential support or resistance levels. The script also manages the number of lines plotted to maintain a clear and uncluttered chart.
CVD Divergence Strategy.1.mmThis is the matching Strategy version of Indicator of the same name.
As a member of the K1m6a Lions discussion community we often use versions of the Cumulative Volume Delta indicator
as one of our primary tools along with RSI, RSI Divergences, Open interest, Volume Profile, TPO and Fibonacci levels.
We also discuss visual interpretations of CVD Divergences across multiple time frames much like RSI divergences.
RSI Divergences can be identified as possible Bullish reversal areas when the RSI is making higher low points while
the price is making lower low points.
RSI Divergences can be identified as possible Bearish reversal areas when the RSI is making lower high points while
the price is making higher high points.
CVD Divergences can also be identified the same way on any timeframe as possible reversal signals. As with RSI, these Divergences
often occur as a trend's momentum is giving way to lower volume and areas when profits are being taken signaling a possible reversal
of the current trending price movement.
Hidden Divergences are identified as calculations that may be signaling a continuation of the current trend.
Having not found any public domain versions of a CVD Divergence indicator I have combined some public code to create this
indicator and matching strategy. The calculations for the Cumulative Volume Delta keep a running total for the differences between
the positive changes in volume in relation to the negative changes in volume. A relative upward spike in CVD is created when
there is a large increase in buying vs a low amount of selling. A relative downward spike in CVD is created when
there is a large increase in selling vs a low amount of buying.
In the settings menu, the is a drop down to be used to view the results in alternate timeframes while the chart remains on current timeframe. The Lookback settings can be adjusted so that the divs show on a more local, spontaneous level if set at 1,1,60,1. For a deeper, wider view of the divs, they can be set higher like 7,7,60,7. Adjust them all to suit your view of the divs.
To create this indicator/strategy I used a portion of the code from "Cumulative Volume Delta" by @ contrerae which calculates
the CVD from aggregate volume of many top exchanges and plots the continuous changes on a non-overlay indicator.
For the identification and plotting of the Divergences, I used similar code from the Tradingview Technical "RSI Divergence Indicator"
This indicator should not be used as a stand-alone but as an additional tool to help identify Bullish and Bearish Divergences and
also Bullish and Bearish Hidden Divergences which, as opposed to regular divergences, may indicate a continuation.
CVD Divergence Indicator.1.mmAs a member of the K1m6a Lions discussion community we often use versions of the Cumulative Volume Delta indicator
as one of our primary tools along with RSI, RSI Divergences, Open interest, Volume Profile, TPO and Fibonacci levels.
We also discuss visual interpretations of CVD Divergences across multiple time frames much like RSI divergences.
RSI Divergences can be identified as possible Bullish reversal areas when the RSI is making higher low points while
the price is making lower low points.
RSI Divergences can be identified as possible Bearish reversal areas when the RSI is making lower high points while
the price is making higher high points.
CVD Divergences can also be identified the same way on any timeframe as possible reversal signals. As with RSI, these Divergences
often occur as a trend's momentum is giving way to lower volume and areas when profits are being taken signaling a possible reversal
of the current trending price movement.
Hidden Divergences are identified as calculations that may be signaling a continuation of the current trend.
Having not found any public domain versions of a CVD Divergence indicator I have combined some public code to create this
indicator and matching strategy. The calculations for the Cumulative Volume Delta keep a running total for the differences between
the positive changes in volume in relation to the negative changes in volume. A relative upward spike in CVD is created when
there is a large increase in buying vs a low amount of selling. A relative downward spike in CVD is created when
there is a large increase in selling vs a low amount of buying.
In the settings menu, the is a drop down to be used to view the results in alternate timeframes while the chart remains on current timeframe. The Lookback settings can be adjusted so that the divs show on a more local, spontaneous level if set at 1,1,60,1. For a deeper, wider view of the divs, they can be set higher like 7,7,60,7. Adjust them all to suit your view of the divs.
To create this indicator/strategy I used a portion of the code from "Cumulative Volume Delta" by @ contrerae which calculates
the CVD from aggregate volume of many top exchanges and plots the continuous changes on a non-overlay indicator.
For the identification and plotting of the Divergences, I used similar code from the Tradingview Technical "RSI Divergence Indicator"
This indicator should not be used as a stand-alone but as an additional tool to help identify Bullish and Bearish Divergences and
also Bullish and Bearish Hidden Divergences which, as opposed to regular divergences, may indicate a continuation.