PVSRA Volume Suite with Volume DeltaPVSRA Volume Suite with Volume Delta
๐น Overview
This indicator is a Volume Suite that enhances PVSRA (Price, Volume, Support, Resistance Analysis) by incorporating Volume Delta and AI-driven predictive alerts. It is designed to help traders analyze volume pressure, market trends, and price movements with color-coded visualizations.
๐ Key Features
PVSRA Volume Color Coding โ Highlights vector candles based on extreme volume/spread conditions.
Volume Delta Analysis โ Tracks buying/selling pressure using up/down volume data.
AI-Powered Predictive Alerts โ Identifies potential trend shifts based on volume and trend context.
Volatility-Adjusted Thresholds โ Dynamically adapts volume conditions based on ATR (Average True Range).
Customizable MA & Symbol Overrides โ Allows traders to tweak settings for personalized market insights.
Debug & Diagnostic Labels โ Shows statistical z-scores, thresholds, and volume dynamics.
How It Works
PVSRA Color Coding โ The script classifies candles into four categories based on volume and spread analysis:
๐ด Red Vector โ Extreme bearish volume/spread
๐ข Green Vector โ Extreme bullish volume/spread
๐ฃ Violet Vector โ Above-average bearish volume
๐ต Blue Vector โ Above-average bullish volume
Volume Delta Calculation โ Uses lower timeframe volume analysis to estimate up/down volume differentials.
Trend & Predictive Alerts โ Combines EMA crossovers with statistical volume analysis to detect potential trend shifts.
Volatility Adaptation โ Adjusts volume thresholds based on ATR, making signals more reliable in changing market conditions.
Custom Symbol Override โ Fetches PVSRA data from a different instrument, useful for index-based volume analysis.
Customizable Inputs
PVSRA Color Settings โ Modify candle color schemes for better visual clarity.
Volume Delta Colors โ Customize delta volume body, wick, and border colors.
AI Settings โ Tune z-score thresholds, lookback periods, and enable predictive alerts.
Symbol Overrides โ Analyze volume from a different market or asset.
Moving Average (MA) Settings โ Display a volume-based moving average for trend confirmation.
Important Notes
Works best on intraday timeframes where volume data is reliable.
Lower timeframe volume delta estimates might not be precise for all assets.
No guarantees of accuracy โ Use alongside other confluence tools for decision-making.
Credits & Open-Source Notice
This script is based on PVSRA methodologies and integrates Volume Delta analysis. Special thanks to Traders Reality and TradingView for their contributions to volume-based analysis.
Vectorcandles
True VolumeThis indicator is designed to provide in-depth analysis of volume data from multiple sources and distinguish highly liquid candles by measuring the density of the volume. By focusing on the density and concentration of volume, rather than just the volume itself, it offers a more nuanced view of the market. This can be particularly beneficial in markets like cryptocurrencies, where understanding the role of market makers versus retail traders is crucial for strategic trading.
This is how it works:
Multiple Asset Integration:
Unlike standard volume indicators, True Volume allows the inclusion of up to four different assets (or the same asset from various exchanges) into its volume calculations. This feature provides a broader and more accurate total volume representation, essential in markets like cryptocurrencies where volume is dispersed across multiple exchanges.
Adjustable Time Anchors:
It offers various time anchor options, allowing traders to analyze volume data over different time periods or a specific amount of lookback candles. This flexibility helps in understanding volume trends over both short and long-term time frames.
Volume Density Analysis:
The core of this indicator is the innovative concept of Volume Density. It's calculated using a sigmoid function that normalizes the volume-to-price movement ratio in a unique way without needing a max cap or having the density column spike off the chart. This method helps in distinguishing between normal volume fluctuations and those that are unusually dense for the given price movement. This distinction is key in identifying potential market maker activities.
The Visuals:
The Volume Density is displayed in a unique way without compromising the original volume bars or cap the density. Infinite density can essentially be represented without having an infinitely large bar or caping out the density data. There's also two different color themes, optional bar color, and an option to flip the density bars up-side down for a different representation. Each of the original volume sources can be displayed separately as well. All colors as customizable as well for your own preference.
Price Volume Trend (PVT):
Included in this indicator is also the Price Volume Trend, which cumulatively measures the density delta, offering insights into the longer-term momentum of the market.
How do I trade it?
This indicator aims to give you insight into 'the other side of the trade', the Market Makers. When you buy, they provide liquidity by selling to you. That drives the Volume Density up.
Consider whether the market maker is currently long or short and might need to cover their position by wicking price back, or "adjust inventory". Especially towards the end of a market session.
Consider dense candles during market gaps or weekends to be market manipulation moves.
The density also goes up when stop losses are hit. If price makes a higher high or lower low, high density could indicate a liquidation event.
Traders Reality Vector Candle ZonesVector Candle Zone indicator displays areas of unrecovered liquidity based on PVSRA with override option for the chart symbol.
Developed for TradersReality by infernixx with library conversion by peshocore
Traders Reality MainThis indicator serves as the Tradingview equivalent of an MT4 indicator suite.
It differentiates from existing TV indicators in its style and total feature set (most notably PVSRA and PVSRA Override)
It was originally designed for forex markets, and it will work for crypto as well, but it has not been tested on stocks.
List of features:
PVSRA Candles
Market boxes (NY/JP/ HK /UK/ FR and Brinks Boxes)
5/13/50/200/800 EMAs (cloud for 50EMA)
Pivot points (S/M/R 1,2,3; PP )
Yesterday and Last Week price range
Average Daily Range (Weekly and Monthly as well)
Daily Open
PVSRA Override
Psychological High/Low
Vector Candle Zones
All of these are configurable in the indicator settings.
Usage instructions:
PVSRA Candle colors meaning:
Green (bull) and red (bear): Candles with volume >= 200% of the average volume of the 10 previous chart candles, and candles where the product of candle spread x candle volume is >= the highest for the 10 previous chart time candles.
Blue (bull) and blue-violet (bear): Candles with volume >= 150% of the average volume of the 10 previous chart candles
PVSRA Override
In order to get reliable bar coloring, we need accurate data. If you're on a chart with low volume on some obscure exchange, you may want to use another exchanges datafeed for the symbol you are on to calculate the PVSRA bar colors with. This lets you do exactly that. By default it's off, but you can turn it on and use INDEX:BTCUSD, or really any other chart you want. You can combine charts too, e.g. use BINANCE:BTCUSDT+COINBASE:BTCUSD.
PVSRA Alerts
Alerts can be made for PVSRA "vector"/"climax" candles:
1. Create Alert (Clock with + sign)
2. Set Condition: "Traders Reality",
3. Select "Alert on Vector Candle",
4. Set it to Once per Bar,
5. choose your notification options.
Market boxes
The market boxes times are configurable and will change depending on the exchange timezone. I recommend to pick your main exchange/chart and adjust the times so that they are correct. Technically you will need to shift the time from the exchanges' timezone to GMT . Default values should be good for UTC based exchanges in current US+UK summer time.
Psychological High/Low
Configurable for Crypto or Forex - draws the perceived Psychological High/Low ranges for the week. Can display historical values too.
Vector Candle Zones
displays unrecovered liquidity left behind on unrecovered vectors. Configurable to take into account candle bodies or candles and wicks.
Recommended additional Tradingview indicator(s):
- TDI - Goldminds, Edited for Market Makers Method by Jakub Donovan
Footnotes
The code was originally by plasmapug, continued development (with permission) is now done by infernix and peshocore and xtech5192 in collaboration with TradersReality.
If you have suggestions or questions, you can message me or leave a comment.
Traders_Reality_LibLibrary "Traders_Reality_Lib"
This library contains common elements used in Traders Reality scripts
calcPvsra(pvsraVolume, pvsraHigh, pvsraLow, pvsraClose, pvsraOpen, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, darkGreyCandleColor, lightGrayCandleColor)
โโcalculate the pvsra candle color and return the color as well as an alert if a vector candle has apperared.
Situation "Climax"
Bars with volume >= 200% of the average volume of the 10 previous chart TFs, or bars
where the product of candle spread x candle volume is >= the highest for the 10 previous
chart time TFs.
Default Colors: Bull bars are green and bear bars are red.
Situation "Volume Rising Above Average"
Bars with volume >= 150% of the average volume of the 10 previous chart TFs.
Default Colors: Bull bars are blue and bear are violet.
โโParameters:
โโโโ pvsraVolume : the instrument volume series (obtained from request.sequrity)
โโโโ pvsraHigh : the instrument high series (obtained from request.sequrity)
โโโโ pvsraLow : the instrument low series (obtained from request.sequrity)
โโโโ pvsraClose : the instrument close series (obtained from request.sequrity)
โโโโ pvsraOpen : the instrument open series (obtained from request.sequrity)
โโโโ redVectorColor : red vector candle color
โโโโ greenVectorColor : green vector candle color
โโโโ violetVectorColor : violet/pink vector candle color
โโโโ blueVectorColor : blue vector candle color
โโโโ darkGreyCandleColor : regular volume candle down candle color - not a vector
โโโโ lightGrayCandleColor : regular volume candle up candle color - not a vector
@return
adr(length, barsBack)
โโParameters:
โโโโ length : how many elements of the series to calculate on
โโโโ barsBack : starting possition for the length calculation - current bar or some other value eg last bar
@return adr the adr for the specified lenght
adrHigh(adr, fromDo)
โโCalculate the ADR high given an ADR
โโParameters:
โโโโ adr : the adr
โโโโ fromDo : boolean flag, if false calculate traditional adr from high low of today, if true calcualte from exchange midnight
@return adrHigh the position of the adr high in price
adrLow(adr, fromDo)
โโParameters:
โโโโ adr : the adr
โโโโ fromDo : boolean flag, if false calculate traditional adr from high low of today, if true calcualte from exchange midnight
@return adrLow the position of the adr low in price
splitSessionString(sessXTime)
โโgiven a session in the format 0000-0100:23456 split out the hours and minutes
โโParameters:
โโโโ sessXTime : the session time string usually in the format 0000-0100:23456
@return
calcSessionStartEnd(sessXTime, gmt)
โโcalculate the start and end timestamps of the session
โโParameters:
โโโโ sessXTime : the session time string usually in the format 0000-0100:23456
โโโโ gmt : the gmt offset string usually in the format GMT+1 or GMT+2 etc
@return
drawOpenRange(sessXTime, sessXcol, showOrX, gmt)
โโdraw open range for a session
โโParameters:
โโโโ sessXTime : session string in the format 0000-0100:23456
โโโโ sessXcol : the color to be used for the opening range box shading
โโโโ showOrX : boolean flag to toggle displaying the opening range
โโโโ gmt : the gmt offset string usually in the format GMT+1 or GMT+2 etc
@return void
drawSessionHiLo(sessXTime, show_rectangleX, show_labelX, sessXcolLabel, sessXLabel, gmt, sessionLineStyle)
โโParameters:
โโโโ sessXTime : session string in the format 0000-0100:23456
โโโโ show_rectangleX : show the session high and low lines
โโโโ show_labelX : show the session label
โโโโ sessXcolLabel : the color to be used for the hi/low lines and label
โโโโ sessXLabel : the session label text
โโโโ gmt : the gmt offset string usually in the format GMT+1 or GMT+2 etc
โโโโ sessionLineStyle : the line stile for the session high low lines
@return void
calcDst()
โโcalculate market session dst on/off flags
@return indicating if DST is on or off for a particular region
timestampPreviousDayOfWeek(previousDayOfWeek, hourOfDay, gmtOffset, oneWeekMillis)
โโTimestamp any of the 6 previous days in the week (such as last Wednesday at 21 hours GMT)
โโParameters:
โโโโ previousDayOfWeek : Monday or Satruday
โโโโ hourOfDay : the hour of the day when psy calc is to start
โโโโ gmtOffset : the gmt offset string usually in the format GMT+1 or GMT+2 etc
โโโโ oneWeekMillis : the amount if time for a week in milliseconds
@return the timestamp of the psy level calculation start time
getdayOpen()
โโget the daily open - basically exchange midnight
@return the daily open value which is float price
newBar(res)
โโnew_bar: check if we're on a new bar within the session in a given resolution
โโParameters:
โโโโ res : the desired resolution
@return true/false is a new bar for the session has started
toPips(val)
โโto_pips Convert value to pips
โโParameters:
โโโโ val : the value to convert to pips
@return the value in pips
rLabel(ry, rtext, rstyle, rcolor, valid, labelXOffset)
โโa function that draws a right aligned lable for a series during the current bar
โโParameters:
โโโโ ry : series float the y coordinate of the lable
โโโโ rtext : the text of the label
โโโโ rstyle : the style for the lable
โโโโ rcolor : the color for the label
โโโโ valid : a boolean flag that allows for turning on or off a lable
โโโโ labelXOffset : how much to offset the label from the current position
rLabelOffset(ry, rtext, rstyle, rcolor, valid, labelXOffset)
โโa function that draws a right aligned lable for a series during the current bar
โโParameters:
โโโโ ry : series float the y coordinate of the lable
โโโโ rtext : the text of the label
โโโโ rstyle : the style for the lable
โโโโ rcolor : the color for the label
โโโโ valid : a boolean flag that allows for turning on or off a lable
โโโโ labelXOffset : how much to offset the label from the current position
rLabelLastBar(ry, rtext, rstyle, rcolor, valid, labelXOffset)
โโa function that draws a right aligned lable for a series only on the last bar
โโParameters:
โโโโ ry : series float the y coordinate of the lable
โโโโ rtext : the text of the label
โโโโ rstyle : the style for the lable
โโโโ rcolor : the color for the label
โโโโ valid : a boolean flag that allows for turning on or off a lable
โโโโ labelXOffset : how much to offset the label from the current position
drawLine(xSeries, res, tag, xColor, xStyle, xWidth, xExtend, isLabelValid, labelXOffset, validTimeFrame)
โโa function that draws a line and a label for a series
โโParameters:
โโโโ xSeries : series float the y coordinate of the line/label
โโโโ res : the desired resolution controlling when a new line will start
โโโโ tag : the text for the lable
โโโโ xColor : the color for the label
โโโโ xStyle : the style for the line
โโโโ xWidth : the width of the line
โโโโ xExtend : extend the line
โโโโ isLabelValid : a boolean flag that allows for turning on or off a label
โโโโ labelXOffset : how much to offset the label from the current position
โโโโ validTimeFrame : a boolean flag that allows for turning on or off a line drawn
drawLineDO(xSeries, res, tag, xColor, xStyle, xWidth, xExtend, isLabelValid, labelXOffset, validTimeFrame)
โโa function that draws a line and a label for the daily open series
โโParameters:
โโโโ xSeries : series float the y coordinate of the line/label
โโโโ res : the desired resolution controlling when a new line will start
โโโโ tag : the text for the lable
โโโโ xColor : the color for the label
โโโโ xStyle : the style for the line
โโโโ xWidth : the width of the line
โโโโ xExtend : extend the line
โโโโ isLabelValid : a boolean flag that allows for turning on or off a label
โโโโ labelXOffset : how much to offset the label from the current position
โโโโ validTimeFrame : a boolean flag that allows for turning on or off a line drawn
drawPivot(pivotLevel, res, tag, pivotColor, pivotLabelColor, pivotStyle, pivotWidth, pivotExtend, isLabelValid, validTimeFrame, levelStart, pivotLabelXOffset)
โโdraw a pivot line - the line starts one day into the past
โโParameters:
โโโโ pivotLevel : series of the pivot point
โโโโ res : the desired resolution
โโโโ tag : the text to appear
โโโโ pivotColor : the color of the line
โโโโ pivotLabelColor : the color of the label
โโโโ pivotStyle : the line style
โโโโ pivotWidth : the line width
โโโโ pivotExtend : extend the line
โโโโ isLabelValid : boolean param allows to turn label on and off
โโโโ validTimeFrame : only draw the line and label at a valid timeframe
โโโโ levelStart : basically when to start drawing the levels
โโโโ pivotLabelXOffset : how much to offset the label from its current postion
@return the pivot line series
getPvsraFlagByColor(pvsraColor, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, lightGrayCandleColor)
โโconvert the pvsra color to an internal code
โโParameters:
โโโโ pvsraColor : the calculated pvsra color
โโโโ redVectorColor : the user defined red vector color
โโโโ greenVectorColor : the user defined green vector color
โโโโ violetVectorColor : the user defined violet vector color
โโโโ blueVectorColor : the user defined blue vector color
โโโโ lightGrayCandleColor : the user defined regular up candle color
@return pvsra internal code
updateZones(pvsra, direction, boxArr, maxlevels, pvsraHigh, pvsraLow, pvsraOpen, pvsraClose, transperancy, zoneupdatetype, zonecolor, zonetype, borderwidth, coloroverride, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, lightGrayCandleColor)
โโa function that draws the unrecovered vector candle zones
โโParameters:
โโโโ pvsra : internal code
โโโโ direction : above or below the current pa
โโโโ boxArr : the array containing the boxes that need to be updated
โโโโ maxlevels : the maximum number of boxes to draw
โโโโ pvsraHigh : the pvsra high value series
โโโโ pvsraLow : the pvsra low value series
โโโโ pvsraOpen : the pvsra open value series
โโโโ pvsraClose : the pvsra close value series
โโโโ transperancy : the transparencfy of the vecor candle zones
โโโโ zoneupdatetype : the zone update type
โโโโ zonecolor : the zone color if overriden
โโโโ zonetype : the zone type
โโโโ borderwidth : the width of the border
โโโโ coloroverride : if the color overriden
โโโโ redVectorColor : the user defined red vector color
โโโโ greenVectorColor : the user defined green vector color
โโโโ violetVectorColor : the user defined violet vector color
โโโโ blueVectorColor : the user defined blue vector color
โโโโ lightGrayCandleColor : the user defined regular up candle color
cleanarr(arr)
โโclean an array from na values
โโParameters:
โโโโ arr : the array to clean
@return if the array was cleaned
calcPsyLevels(oneWeekMillis, showPsylevels, psyType, sydDST)
โโcalculate the psy levels
4 hour res based on how mt4 does it
mt4 code
int Li_4 = iBarShift(NULL, PERIOD_H4, iTime(NULL, PERIOD_W1, Li_0)) - 2 - Offset;
ObjectCreate("PsychHi", OBJ_TREND, 0, Time , iHigh(NULL, PERIOD_H4, iHighest(NULL, PERIOD_H4, MODE_HIGH, 2, Li_4)), iTime(NULL, PERIOD_W1, 0), iHigh(NULL, PERIOD_H4,
iHighest(NULL, PERIOD_H4, MODE_HIGH, 2, Li_4)));
so basically because the session is 8 hours and we are looking at a 4 hour resolution we only need to take the highest high an lowest low of 2 bars
we use the gmt offset to adjust the 0000-0800 session to Sydney open which is at 2100 during dst and at 2200 otherwize. (dst - spring foward, fall back)
keep in mind sydney is in the souther hemisphere so dst is oposite of when london and new york go into dst
โโParameters:
โโโโ oneWeekMillis : a constant value
โโโโ showPsylevels : should psy levels be calculated
โโโโ psyType : the type of Psylevels - crypto or forex
โโโโ sydDST : is Sydney in DST
@return




