OPEN-SOURCE SCRIPT
Nth-Occurrence Custom barssince() Function by Cryptorhythms [CR]

Nth-Occurrence Custom barssince() Function by Cryptorhythms [CR]
Description
The vanilla barssince() function in pine only finds the number of bars since the most recent occurrence of the condition. This version allows you to specify an Nth occurrence back to check the bars since! Its also a nice little one liner.
I really hope you enjoy it and if you're looking for more, this is our 79th script on TV, so there is plenty to choose from!
Let me know in the comments if you create anything useful from this or think of anyway to improve it!
Description
The vanilla barssince() function in pine only finds the number of bars since the most recent occurrence of the condition. This version allows you to specify an Nth occurrence back to check the bars since! Its also a nice little one liner.
I really hope you enjoy it and if you're looking for more, this is our 79th script on TV, so there is plenty to choose from!
Let me know in the comments if you create anything useful from this or think of anyway to improve it!
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Twitter - twitter.com/cryptorhythms
Cryptorhythms Group Chat - t.me/cryptorhythms
Cryptorhythms Group Chat - t.me/cryptorhythms
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Twitter - twitter.com/cryptorhythms
Cryptorhythms Group Chat - t.me/cryptorhythms
Cryptorhythms Group Chat - t.me/cryptorhythms
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.