Candlestick Percentile RankCANDLESTICK PERCENTILE RANK
█ OVERVIEW
This script is designed to sample all available candles within a chosen time frame and provide a candlestick percentile rank to each candle. This script works by measuring a candle's body or its low to high value to the upside, or to the downside in percentage or in dollar value. Once the candle is measured its given a value based on all the previous measurements. You will be able to know if a body ( or a full candle/bar ) is above, or below a certain percentile level. By doing this you're effectively going to know if a candle is under performing or under-performing compared to the chart's history.
Example : A candle that did a 30% move vs another did a 10% and a third did a 5%. Here we 3 candles. The one that did a 30% is going to be ranked at 100 because it's the highest while the 5% candle ranks at 0 and the 10% candles ranks at 50. you see how this works. Having a candle in the 90th percentile means at that time it scored better than 90% of the preceding candles based on its move ( in dollar or percentage ).
So imagine you have an organic move of an up trend, ideally and what you want to see is this ; a candle with a low rank followed by one that's higher, followed by one that's also higher until the trend stops and you see a pin bar or whatever topping candle. You expect to see a rank going from low value to high value to suddenly sharply decrease to low value.
Constant low values may indicate lower volatility or time to change. For example, a doji candle will create a very low percentile rank value ( body-wise ). A high percentile rank value means high volatility on body and full candle calculations.
^ This is only one use of it.
A trendline may also form with a breakout points and information about the trend of the volatility of recent candles. Moving averages when applied to these calculations and to the percentile ranks can absolutely help in making these trends a bit smoother which is why you can add them to the graph. if you wish.
This script can be used in multiple ways including as a measure of volatility. or for statistical purposes. If I know the 50th percentile of a candle value I can know a very critical information about an asset's behavior and how volatile it is compared to another. There are many questions that can be answered using this script. How many times has this asset printed a candle of x% in the past y amount of time and how often does that happen. Is this candle or that truly rare ?
This script also has an option to highlight a specific percentile level showing its value. You can also see the number of sampled candles for clarity on the reliability of the data.
In conclusion, candlesticks effect each others. The whole candlestick/bars patterns is based on this. The percentile Rank is an effective way to observe and study these effects. The percentile rank shows you how on a measuring stick from 0 to 100 how a candle ( body or full low-high ) ranks compared to other candles in the past based on dollar value or percentage value. There are many untapped usages of the percentile rank when applied to candlesticks calculations and I hope this script can help you with this. If one can study the behavior of an asset and its bars percentile ranks they can unlock some probabilistic advantages.
█ Future Plans and upgrades to this script may include :
1. Count the times a percentile level is hit.
2. Display details about the highest/lowest levels.
and more! feel free to let me know what you'd like to see!
█ How to use :
1. Put the script on your chart
2. Navigate to the settings
give the script a few seconds and you should be set.
Percentilerank
TTP PNR filterPNR filter uses the "percentile nearest rank" method to produce signals from any source including oscillator indicators and price bars.
Features:
* Length - how many candles back in time to use for calculating PNR
* % low and high - what range of the spread of values captured will form the PNR band. Use 99&100 to create a band on the 1% highest percentile or 0&1 to create a band in the lowest percentile. It accepts float numbers so you can find very rare occurrences.
* src - by default it will use the close price but PNR filter can be used with any source. It's particularly useful when working with oscillators like RSI, MACD, ADX, etc.
* Signal direction - The indicator will print 1 when the selected conditions are met. Once the PNR band is plotted you can chose from cross over, cross under, above and below conditions to trigger a signal.
* Signal source - the band consists in a % low and % high, this option allows you to pick which band will be used with the "signal direction" parameter.
Example configuration:
1) Select 200 as the length
2) Select % low 0 and % high 1
3) Add RSI to the chart and select it as the source parameter
4) Select signal direction cross over
5) Select signal source % high which corresponds to the 1% band
In this setup you are finding values of RSI that in the past 200 candles have been that low only 1% of the time. With each new candle the calculation window will move as well leaving the oldest candle out.
David Varadi Intermediate OscillatorThe David Varadi Intermediate Oscillator (DVI) is a composite momentum oscillator designed to generate trading signals based on two key factors: the magnitude of returns over different time windows and the stretch, which measures the relative number of up versus down days. By combining these factors, the DVI aims to provide a reliable and objective assessment of market trends and momentum.
Methodology:
To calculate the DVI, a specific formula is applied. The magnitude component involves averaging smoothed returns over various lengths, weighted according to user-defined parameters. This calculation helps determine the magnitude of price changes. The stretch component follows a similar process, averaging smoothed returns over different lengths to gauge market momentum. Users have the flexibility to adjust the weights and lengths to suit their trading preferences and styles.
Utility:
The DVI offers versatility in its applications. It can be used for both momentum trading and trend analysis due to its smooth and consistent signals. Unlike some other oscillators, the DVI provides longer and uncorrelated signals, allowing traders to effectively combine trend-following and mean-reversion strategies. For example, the DVI is adept at identifying overbought levels above the 200-day moving average, serving as a useful tool for determining exit points during price strength and even potential shorting opportunities. Traders can develop simple trading systems based on the DVI, buying above the 200-day moving average and selling when the DVI exceeds a specified threshold. Conversely, they can consider short positions below the 200-day moving average and cover when the DVI falls below a specific threshold. The DVI's objective approach to analyzing market momentum makes it a valuable resource for traders seeking to identify trading opportunities.
Key Features:
Bar coloring: based on Trend, Extremeties or Reversions
Reversions: Potential reversal points marked with triangles above\below oscillator
Extremity Hues: Highlighting oxcillator reaching traditional OB\OS levels
Example Charts:
Percentile Rank of Moving Average Convergence DivergenceThis simple indicator provides you three useful information of the Moving Average Convergence Divergence (MACD) indicator:
The percentile rank of the current value of the MACD line, displayed by the bright blue line.
The percentile rank of the current value of the Signal line, displayed by the dark blue line.
The percentile rank of the current value of the Histogram line, displayed by the olive histogram.
This indicator can be useful to identify the strength of trend. This indicator makes the assumption that market tends to revert into the opposite direction. If the market has been trending a lot, it should consolidate for a while later. If the market has been consolidating for a long time, it would begin trending real soon.
When we see a low percentile rank, no matter which line it is, this tells that the market hasn't been moving much, or there is little momentum. If the percentile rank stays below the median or even below the first quartile for a long time, this could suggest that the market is ready for the next trend since it has stored quite some energy.
When we see a high percentile rank, no matter which line it is, this tells that the market has been trending a lot, or there is much momentum. If the percentile rank stays above the median or even above the third quartile for a long time, it is probable that the market has used up much of its energy and is going to take a rest (consolidate).
Percentile Rank of Bollinger BandsThis simple indicator provides you three useful information with Bollinger Bands:
How wide the current width (standard deviation) of the Bollinger Band is.
Compared to the widths in the past, is the current width relatively small or big? Value is expressed in percentile format.
What the "relative position of current price" to the current Bollinger Band is.
This indicator can be useful to identify whether the Bollinger Band has substantially "expanded" or "squeezed."
First, divide the current standard deviation by the current price, we get the current width. The current width is displayed by the columns at the bottom. When the current width becomes wider, the column becomes taller, and the color is dark green. On the contrary, if the width becomes narrower, the column becomes shorter and the color is light green.
Next, compare the current width with the previous N widths, we get the percentile rank for the current width. The percentile rank is shown by the thicker line graph. When the percentile rank grows, it is green; whereas when the rank declines, the color is red.
Lastly, calculate (close - lower)/(upper - lower) and we get an idea of the relative height of the current price, compared to the upper and lower band. This is displayed by the thinner line graph. When the relative position becomes higher, the color is in aqua. It is in blue when the relative position becomes lower. Note that since closing prices can go above the upper band or go below the lower band, the values may be greater than 100 or less than 0.
ROC vs BTCThis is a modification of my Rate of Change Percentile script, used to compare the current ticker (e.g. Altcoins) to BTC.
Essentially we are looking at (Current Ticker ROC percentile) vs (Bitcoin ROC percentile).
In other words, we are using the ROC value of both the current ticker and BTC, and ranking each based on their previous ROC.
We compare the rankings to gauge the relative overperformance or underperformance of the current ticker vs BTC.
The blue line is BTC, the columns are the current ticker.
Green columns above the blue line indicate positive ROC and current ticker has higher ROC ranking than BTC.
Red columns below the blue line indicate negative ROC and current ticker has a higher ROC ranking than BTC.
*** PLEASE LEAVE A LIKE AND FOLLOW IF YOU ENJOY THE SCRIPT ***
Any questions, comments or feedback I'd love to hear from you below!
Volatility IndexThis is a composite volatility index to show percentile of current volatility compared to that of the last 52 bars. As this is a weekly chart (and this script is intended for usage on weekly charts) we can see the yearly percentile rank of volatility.
As shown when volatility is in the lower 25%tile (viewed on weekly) the market is calm and likes to rise; when the volatility is above the 25%tile you can see that the market tends to have larger and 'choppier' moves.
This is /not/ 'just the vix' this takes into consideration the volatility of all major US indexes including the SPX500, Dow 30, Nasdaq 100, and Russel 2000.
Please remember that this is just plotting:( volatility index - lowest(index,52) )/( highest(index,52)-lowest(index,52) ) so for 'yearly percentile' check the weekly chart (52 weeks = 1yr)
UPDATED Laguerre PPO PercentileRank Mkt Tops & BottomsUPDATED Laguerre PPO PercentileRank Market Tops & Bottoms squeezed into a line chart seems to be more precise