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

Nth-Occurrence Custom barssince() Function by Cryptorhythms

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!
Supprimer des scripts favoris Ajouter aux scripts favoris


This is a crazy good gem. Love it! Elegant, simple, brilliant and raw beauty. Thanks for this.
+2 Répondre
amazing stuff. always so helpful!
+1 Répondre
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
+1 Répondre
Amazing and elegant implementation! Thanks for sharing ;)
+1 Répondre
what is the usage of this?
theheirophant alirezakaj
@alirezakaj, you would use it in the same places that you would use barssince(). But with this version you can choose the barssince the third occurrence, or the 12th. In terms of trading there are tons of places you can use something like this. It simply counts how many bars have passed since the specified condition occurred.
Accueil Screener d'actions Screener Forex Screener Crypto Calendrier économique Comment ça marche Caractéristiques du graphique Prix Parrainer un ami Règles de conduite Centre d'aide Solutions site web & courtier Widgets Solutions de cartographie Bibliothèque de graphiques allégés Blog & News Twitter
Profil Paramètres du Profil Compte et Facturation Parrainer un ami Mes tickets au support Centre d'aide Idées Publiées Followers Suivi(e) Messages privés Chat Se Déconnecter