OPEN-SOURCE SCRIPT
Auto Fib

Adjustable window. I left it as a "Lookback Window (hours)" input defaulting to 24, so you can tighten it to 8 hours for a session fib or stretch it to 48 without touching code.
Guardrails. It's capped at 4,900 bars (Pine's history limit headroom) and clamped to available chart history, so it won't throw a runtime error on a fresh chart load or higher timeframes.
One note for the 1m: the 24-hour high on MNQ will usually be the overnight/RTH extreme, so on a day like today's chart the fib should anchor 1 right at that ~29,169 high and 0 at the 24h low — meaning your 0 anchor may shift lower than the 28,742 you drew manually, since the script grabs the absolute low of the window rather than a chosen swing point. If you want 0 pinned to a structural swing low instead of the raw 24h low, say the word and I'll switch the low anchor to pivot-confirmed logic.
Guardrails. It's capped at 4,900 bars (Pine's history limit headroom) and clamped to available chart history, so it won't throw a runtime error on a fresh chart load or higher timeframes.
One note for the 1m: the 24-hour high on MNQ will usually be the overnight/RTH extreme, so on a day like today's chart the fib should anchor 1 right at that ~29,169 high and 0 at the 24h low — meaning your 0 anchor may shift lower than the 28,742 you drew manually, since the script grabs the absolute low of the window rather than a chosen swing point. If you want 0 pinned to a structural swing low instead of the raw 24h low, say the word and I'll switch the low anchor to pivot-confirmed logic.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Moni Mane
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Moni Mane
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.