TradingView
TheTradingParrot
Sep 14, 2023 2:40 PM

TTP PNR filter 

Bitcoin all time history indexINDEX

Description

PNR 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.

Release Notes

Added alerts

Release Notes

We've been exploring PNR applied to price and to indicators including moving averages, oscillators and even QFL.

PNR helps us identifying how "rare" a value is and therefore spotting opportunities.

But what if we used PNR to determine how rare is that a signal hasn't triggered in the past X candles?

Introducing the time PNR option.

Example use:

1) As the source select any indicator that prints signals in the chart, for example an indicator that prints 1 every time RSI is crossing above 30. Any signal would do as long as it prints with certain frequency. The external source indicator must be in the same chart.

2) Set the low to 99 and the high to 100

3) Enable the time option.

4) Make sure that the time value matches the value that the signal prints (usually 1)

Notice how the indicator prints some triangles representing how long its taking for the signal to print another signal and thanks to the rank of percentiles you'll be able to tell based on PNR statistics if its taking "too long", if its deviating from the usual frequency of the signal. 🦜

Release Notes

Optimisations to use less resources: use of single PNR call instead of a band of 2 PNRs.



Comments
StrongDominator
Thank you very much! It actually works even better without any external indicator. Just add TP and SL. The results will be impressive even when testing on deep history.
invas0r
Great work! Can you explain how do I set an alert? For example using VWAP, I want it to tell me when to sell, so what do I put under VALUE in the alert? In the chart I see the correct signals, but the alert isn't triggering...
TheTradingParrot
@invas0r, in the alert condition select the PNR indicator and then "PNR signal". Don't add two PNR indicators to the same chart to prevent getting confused which one is the buy which one is the sell. Do the buy alert with one PNR indicator in the chart once done, then modify the indicator parameters to be a sell then create the second alert.
invas0r
@TheTradingParrot, Thank you so much! By the way I hope you keep doing the market update videos, they are always great!
systempromowania
Amazing! please consider option to combine more than one oscylator to calculation
TheTradingParrot
@systempromowania, interesting, how would they combine if more than one? I’ll need to take the max and the min between them ? Or what would you suggest instead?
TheTradingParrot
@systempromowania, you can achieve the same with ADB combining the plugins, should be pretty simple. No need to change any of them. It’s just a different philosophy: many plugins that can be combined in any way vs a single all included indicator.

I used to go for all in one approach butiá prefer the infinite combinations of playing with Lego-like parts at the cost of needing TV premium.
hal1000
cooool
diegopiolo
Thanks Mr Parrot for share your work! I do my part in you tube to help :)
More