While coding some filters into another indicator for Long/Short I noticed that ta.nearest.percentile might be the most useful tool in pinescript I've ever encountered. While percentile_nearest can be used for all kind of things I decided to code moving averages from it and made bands for bottom percentage and top percentage.
The indicator will calculate the top % price of the given bar length. Example settings: length: 150 percentile: 99 So when using 99% it will draw a green line when price is moving above the top 1% price of the last 150 candles. It then calculates if the price is below the bottom 1% of the last 150 candles.
Trading use: Use this indicator to check if the market is leaving normal territory. This signals a breakout move for example the dogecoin pump or the top of the range. I use this indicator to catch bull/bear moves for botting purposes. An other use would be to countertrend trade after the move has ended. With price being in top 1% for a while it is very probable that we see a large correction.
any recommendations on how to set up the ideal settings for 5 mins or 15 mins ?
Honestcowboy
⋅
@lukricky, I don't trade those timeframes. The settings I use is a length of 200 with a percentile of 80 and 0 displacement. This is good enough for me to use as a good trend filter on the hourly and daily charts.
@lukricky, Glad that you like it. It can help improve a lot of trading methods.
pattt128
⋅
man your indicator seems awesome, good work, used for 5 minute LRC/EU, with 50,90,0 for parameters seems working really well (not tested i juste discovered it ), its find major movement and ignore a lot of consolidation zone , there are some small signal but they are overpowered by the good one
Honestcowboy
⋅
@max-p-128, glad to hear that. I personaly use the script to optimise other strategies as a filter system.