• Productos
  • Comunidad
  • Mercados
  • Brokers
  • Más
Empiece
  • Comunidad
  • /Indicadores y estrategias
  • /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!
Indicador Pine Script®
por LonesomeTheBlue
Actualizado
1212

Select market data provided by ICE Data services. Select reference data provided by FactSet. Copyright © 2025 FactSet Research Systems Inc.© 2025 TradingView, Inc. SEC fillings and other documents provided by Quartr.

Más que un producto
  • Supergráficos
Analizadores
  • Acciones
  • ETF
  • Bonos
  • Criptomonedas
  • Pares CEX
  • Pares DEX
  • Pine
Mapas de calor
  • Acciones
  • ETF
  • Cripto
Calendarios
  • Económico
  • Beneficios
  • Dividendos
Más productos
  • Curvas de rendimiento
  • Opciones
  • Flujo de noticias
  • Pine Script®
Aplicaciones
  • Móvil
  • Desktop
Comunidad
  • Red social
  • Muro del amor
  • Recomendar a un amigo
  • Normas internas
  • Moderadores
Ideas
  • Trading
  • Formación
  • Selecciones de los editores
Pine Script
  • Indicadores y estrategias
  • Wizards
  • Autónomos
Herramientas y suscripciones
  • Funcionalidades
  • Precios
  • Datos de mercado
Trading
  • Resumen
  • Brokers
Ofertas especiales
  • Futuros CME Group
  • Futuros Eurex
  • Paquete de acciones de EE.UU.
Acerca de la empresa
  • Quiénes somos
  • Misión espacial
  • Blog
  • Ofertas de empleo
  • Kit de medios
Tienda
  • Tienda TradingView
  • Cartas de tarot para traders
  • C63 TradeTime
Políticas y seguridad
  • Condiciones de uso
  • Exención de responsabilidad
  • Política de privacidad
  • Política de cookies
  • Declaración de accesibilidad
  • Consejos de seguridad
  • Programa de recompensas por encontrar errores
  • Página de estado
Soluciones para empresas
  • Widgets
  • Bibliotecas de gráficos
  • Lightweight Charts™
  • Gráficos avanzados
  • Plataforma de trading
Oportunidades de crecimiento
  • Publicidad
  • Integración de brokers
  • Programa de socios
  • Programa de formación
Comunidad
  • Red social
  • Muro del amor
  • Recomendar a un amigo
  • Normas internas
  • Moderadores
Ideas
  • Trading
  • Formación
  • Selecciones de los editores
Pine Script
  • Indicadores y estrategias
  • Wizards
  • Autónomos
Soluciones para empresas
  • Widgets
  • Bibliotecas de gráficos
  • Lightweight Charts™
  • Gráficos avanzados
  • Plataforma de trading
Oportunidades de crecimiento
  • Publicidad
  • Integración de brokers
  • Programa de socios
  • Programa de formación
Look FirstLook First