Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator("Fibonacci with Phi and Harmonics", overlay=true)
- // Parameters
- length1 = input.int(147, minval=1, title="Support/Resistance Length 1")
- length2 = input.int(258, minval=1, title="Support/Resistance Length 2")
- length3 = input.int(369, minval=1, title="Support/Resistance Length 3")
- phiLevel = input.float(0.618, minval=0, maxval=1, step=0.001, title="Phi Level")
- // Calculate support and resistance for different lengths
- var float support1 = na
- var float resistance1 = na
- var float support2 = na
- var float resistance2 = na
- var float support3 = na
- var float resistance3 = na
- support1 := ta.lowest(low, length1)
- resistance1 := ta.highest(high, length1)
- support2 := ta.lowest(low, length2)
- resistance2 := ta.highest(high, length2)
- support3 := ta.lowest(low, length3)
- resistance3 := ta.highest(high, length3)
- // Plot support and resistance as lines
- plot(support1, color=color.green, title="Support 1", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- plot(resistance1, color=color.red, title="Resistance 1", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- plot(support2, color=color.green, title="Support 2", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- plot(resistance2, color=color.red, title="Resistance 2", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- plot(support3, color=color.green, title="Support 3", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- plot(resistance3, color=color.red, title="Resistance 3", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
- // Calculate Fibonacci levels
- fibonacciLevel(low, high, phiLevel) =>
- fiboRange = (high - low) * phiLevel
- fiboValue = high - fiboRange
- fiboValue
- // Plot Fibonacci levels
- plot(fibonacciLevel(support1, resistance1, phiLevel), color=color.blue, title="Fibonacci Phi Level 1")
- plot(fibonacciLevel(support2, resistance2, phiLevel), color=color.orange, title="Fibonacci Phi Level 2")
- plot(fibonacciLevel(support3, resistance3, phiLevel), color=color.purple, title="Fibonacci Phi Level 3")
Advertisement
Comments
-
- ITS GOOD PLEASE ADD COLOR CANDILES IN 3 RD FIBONACCI PHI LEVEL ABOVE GREEN, BELOW RED PLEASE PUT .....SUPER SIR..... I AM FINE OF YOU.TQ
Add Comment
Please, Sign In to add comment
Advertisement