• Prodotti
  • Comunità
  • Mercati
  • Broker
  • Altro
Inizia
  • Comunità
  • /Indicatori e strategie
  • /Starting

Starting

Start the Script on Last Nth Bar [Experimental]Hello Pine Scripters, Sometimes we need to run some processes in the scripts on last N bar but currently we don't know bar_index value of realtime bar or number of remaining bars before we reached it. So most of us use "start date" as input and run some processes after "start date". This experimental script finds last Nth bar approximately. As you can see in the script we (should) use GMT, otherwise as I see the result might not be accurate (we don't know timezone used on the chart) The idea is to find/use similar bar in the past (using timenow as reference) and then calculate aproximate the time of last Nth bar. the results may not be accurate all the time, also we can not know local holidays etc. At the moment the script works on 1minute or higher time frames (it won't work on less 1min timeframes) In the future if the Pine Team add something like "bar_index_realtime" then we will not need such things. by the way many thanks to Pine Team, they are doing great job. You can use this script in your scripts as you want, no need to ask permission. If you can improve it let me know ;) Enjoy!
Indicatore Pine Script®
di LonesomeTheBlue
Aggiornato
1212

Dati di mercato forniti da ICE Data services. Dati di riferimento forniti da FactSet. Copyright © 2025 FactSet Research Systems Inc.© 2025 TradingView, Inc.

Più che un semplice prodotto
  • Grafici
Screener
  • Azioni
  • ETF
  • Obbligazioni
  • Singole cripto
  • Coppie Cripto
  • Coppie CEX
  • Coppie DEX
  • Pine
Heatmap
  • Azioni
  • ETF
  • Cripto
Calendari
  • Economico
  • Utili
  • Dividendi
Altri prodotti
  • Curve di rendimento
  • Opzioni
  • Notiziario
  • Pine Script®
  • Spunti
Applicazioni
  • Smartphone
  • Desktop
Strumenti e abbonamenti
  • Caratteristiche
  • Costi
  • Dati di mercato
Offerte speciali
  • Futures CME Group
  • Futures Eurex
  • Bundle azioni USA
Informazioni sulla società
  • Chi siamo
  • Manifesto
  • Atleti
  • Blog
  • Carriere
  • Kit multimediale
Merchandising
  • TradingView Shop
  • I tarocchi per i trader
Politiche e sicurezza
  • Condizioni d'uso
  • Declinazione di responsabilità
  • Normativa sulla privacy
  • Politica sui cookies
  • Dichiarazione di accessibilità
  • Rischi per la sicurezza
  • Pagina di stato
Comunità
  • Social network
  • Muro social
  • Invita un amico
  • Regolamento
  • Moderatori
Idee
  • Trading
  • Formazione
  • Selezione editoriale
Pine Script
  • Indicatori e strategie
  • Maestri
  • Freelancer
Soluzioni per le aziende
  • Widget
  • Librerie grafiche
  • Lightweight Charts™
  • Grafici avanzati
  • Piattaforma di trading
Opportunità di crescita
  • Pubblicità
  • Integrazione broker
  • Programma affiliazione
  • Programma di formazione
Look FirstLook First