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
Tradersreality
Traders Reality PVSRA Volume SuitePVSRA volume bars color coded to PVSRA vector candles and with override option and configurable moving average.
Indicator displays volume bars color coded to PVRSA price action and allows the user to override 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
CryptoCurrency Short X-RayIndicator to show the data on short sellers for cryptocurrencies. Color coded as the following:
Orange=Shortsellers are Shorting
Blue =Shortsellers are Covering
Red =Others are Selling
Green =Others are Buying
Includes lines to show the range that shortsellers have recently (within the last 1024 bars) been operating in to give indication on how extended they are, along with 25%, 50%, and 75% levels inbetween. Do not rely exclusively on this indicator as this can change wildly depending on the situation at hand, and be sure to select the short data in the settings that matches the ticker you're trading.
TDI Hedge Strategy
This is the incomplete version but upon multiple requests, I have released it early. All of the strategy and alert functions are yet to be written and I'll get around to it soon.
This indicator aims to be the best TDI indicator on TradingView. It is a strategy or study. It will have all of the filter, entry, and exit conditions for the strategies around the TDI.
What is implemented
MFI or RSI: the MFI is a much better TDI baseline than the RSI, in my opinion, and very effective
EMA or SMA used for the moving averages on fast, slow, and volatility band
Dynamic timeframe: set a factor of current timeframe and indicator will analyse higher timeframe automatically
Manual timeframe: set a higher timeframe to analyse different to currently viewed
Features for later
conditions for TDI filters/entries/exits
Strategy functions to use built-in strategy tester
BTE signal plot for Backtesting & Trading Engine
alerts
Enjoy!
EBB & Flow: a multi-EMA-based BB cloudIntro
This is an idea evolved out of the market maker method and EMA convergence, divergence, and mean reversion.
The market maker method informs us that the 5, 13, 50 and 200 EMAs are important to regulating price. Those EMA lengths are multiples of the 50 and 200 on lower major timeframes -- the 1 minute, 5, 15, 1H, 4H, 1D. I include the 21 because it is also a multiple and in crypto very often respected.
When market makers are testing price, they set their range and spike in the direction they test for liquidity. This can get chaotic. For instance, in a shorter time frame consolidation inside a bigger timeframe uptrend, it can be too easy to forget where you are in the many trends playing out.
When the EMAs are dragged over each other during normal price movement, you get these crisscrossing tracks of price, and the individual breaks can be hard to trace.
The range is what matters, ultimately, and the range is dynamic. In that case, the Bollinger Band is a great tool for detecting outliers in this case.
The Answer
So the answer this indicator seeks to give, is to look for outliers. This gives you a scalping strategy built on Traders Reality thinking and best put together with the PVSRA indicator, which I may include in this indicator just for the sake of concision, but they can work alongside each other or separately.
The key thing is the different EMA clouds, which are bollinger bands. Tight bands mean imminent breaks, favouring the trend. Vector candles out of a zone, pins to the low/high, etc. are all very relevant alongside this indicator.
You can also use it on its own and scalp the breaks of a cloud.
How it works
Each cloud is a standard deviation from their respective EMA, all in the same colour. The deviation multiple is 1.618 by default. Yes, fibonacci sequences are usually nonsense, but it works better with the BB than 2, 2.5 or 3.
Using just the clouds, you can see where each EMA is headed and how it behaves within the deviation of the others.
But that on its own isn't enough.
The indicator will also print snowflakes above and below the candle for notable outliers. It will be in the colour of the cloud it breaks, but only if that break is also breaking the smaller EMA clouds too.
The most snowflakes will be yellow because that's the 13 EMA. That one is dependent on nothing else and every break will print a snowflake. The 21 will be dependent on the 13. The 50 dependent on the 13 and 21 breaks. The 200 the most important.
For example, if the 200 EMA-BB or EBB is broken at the upper band, deviating by more than 162% of price over a 200 period EMA, and that break is not above the 50 EMA cloud, there will be no snowflake. However, if it exceeds the 13, 21, 50, and 200 clouds, then a purple snowflake will appear above the bar.
Any snowflake is an extreme in price. The purple is an especially good point of entry. That doesn't mean it is a perfect entry. You can build position from it, though, and be relatively certain of a price correction in the near future, because not only was this major EMA cloud violated, but all of the smaller ones too.
Reminder
You still need your PVSRA and candlesticks. This indicator on its own may have a nice hit rate for scalping and building position, as an alternative to the TDI or alongside it, but it is not enough on its own, just like the TDI.
Enjoy!
Market Maker BalanceWhere is the market maker in his cycle of building longs or shorts? When is that big drop or big pump coming?
This is a simple and unexpectedly powerful indicator that shows you an estimate of the market maker's position over the last 200 candles. It works on any timeframe.
How does it work?
It combines a simple 10-candle Price Volume Support Resistance Analysis metric of climactic and rising volume. That volume is combined to create a bullish and bearish balance over a period of 200 candles. The curves are smoothed out with a 10 period EMA.
The MMB (Marker Maker Balance) oscillator is the resulting bearish volume - bullish volume, which shows us THEIR position balance.
Indications:
when shorts are increasing (further below 0), we are in a bullish trend -- you should be taking profit on longs
when shorts are flat or decreasing, the trend is due for a reversal -- you should be closing longs and looking to short
when shorts cross 0 to long, the trend is reversing down -- you should be in a short position by now
when longs are increasing, we are in a bearish trend -- you should be taking profits on your shorts
when longs are flat or decreasing, the trend is due for a reversal -- you should be closing your shorts
For extra information, there are also the separate lines for rising and climactic volume to give you early indications of reversal or change in Market Maker behaviour. You can disable them in the Style settings, but they can be a useful early indicator that the current trend is losing strength when rising volume overtakes climax volume (MM's no longer moving out of zones higher/lower).
Ways to use this indicator are quite simple and eerily accurate:
for short term gains, do the opposite of MMs: long when MM are opening more shorts, short when they are opening more longs
for huge positions, mimic the MM position: build long positions / close shorts when MMB is rising, build shorts / close longs when MMB is falling or crosses above 0 (be careful with leverage, begin on 1x leverage)
Note: the results of this indicator will be different for each exchange, because of their different trading volumes per candle. It's advisable to use it for the exchange you're trading on or use a chart that averages all exchanges for that asset, like INDEX:BTCUSD.
For those of you who use the Backtesting & Trading Engine by PineCoders, the BTE Signal plot generates long and short entries as well as filter states. Use this plot as the source for BTE.
Shout out to @infernixx for PVSRA calculations in his awesome Traders Reality indicator, the code of which I shamelessly ripped off and edited for this indicator.
Leave comments below if you want something added.