Code Library / Fibonacci

Pine Script Fib Time Zones

Fibonacci time zones for potential trend change dates.

Language: Pine Script · Category: Fibonacci · Tags: Fibonacci, time zones, Pine Script, time analysis, cycles

Source code

//@version=5
indicator("Fib Time Zones",overlay=true)
fn=array.from(1,2,3,5,8,13,21,34,55,89)
for i=0 to array.size(fn)-1
    fb=bar_index-array.get(fn,i)
    if fb>=0
        line.new(fb,low,fb,high,color=color.new(color.purple,40),style=line.style_dashed,extend=extend.both)

How to use this snippet

This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.

Related snippets