Advertisement
xmd79

Fibonacci with Phi and Harmonics

Jun 3rd, 2024
506
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 1 0
  1. //@version=5
  2. indicator("Fibonacci with Phi and Harmonics", overlay=true)
  3.  
  4. // Parameters
  5. length1 = input.int(147, minval=1, title="Support/Resistance Length 1")
  6. length2 = input.int(258, minval=1, title="Support/Resistance Length 2")
  7. length3 = input.int(369, minval=1, title="Support/Resistance Length 3")
  8. phiLevel = input.float(0.618, minval=0, maxval=1, step=0.001, title="Phi Level")
  9.  
  10. // Calculate support and resistance for different lengths
  11. var float support1 = na
  12. var float resistance1 = na
  13. var float support2 = na
  14. var float resistance2 = na
  15. var float support3 = na
  16. var float resistance3 = na
  17.  
  18. support1 := ta.lowest(low, length1)
  19. resistance1 := ta.highest(high, length1)
  20.  
  21. support2 := ta.lowest(low, length2)
  22. resistance2 := ta.highest(high, length2)
  23.  
  24. support3 := ta.lowest(low, length3)
  25. resistance3 := ta.highest(high, length3)
  26.  
  27. // Plot support and resistance as lines
  28. plot(support1, color=color.green, title="Support 1", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  29. plot(resistance1, color=color.red, title="Resistance 1", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  30.  
  31. plot(support2, color=color.green, title="Support 2", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  32. plot(resistance2, color=color.red, title="Resistance 2", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  33.  
  34. plot(support3, color=color.green, title="Support 3", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  35. plot(resistance3, color=color.red, title="Resistance 3", style=plot.style_line, show_last=1, linewidth=1, trackprice=true, transp=0)
  36.  
  37. // Calculate Fibonacci levels
  38. fibonacciLevel(low, high, phiLevel) =>
  39. fiboRange = (high - low) * phiLevel
  40. fiboValue = high - fiboRange
  41. fiboValue
  42.  
  43. // Plot Fibonacci levels
  44. plot(fibonacciLevel(support1, resistance1, phiLevel), color=color.blue, title="Fibonacci Phi Level 1")
  45. plot(fibonacciLevel(support2, resistance2, phiLevel), color=color.orange, title="Fibonacci Phi Level 2")
  46. plot(fibonacciLevel(support3, resistance3, phiLevel), color=color.purple, title="Fibonacci Phi Level 3")
  47.  
Advertisement
Comments
  • RAMANIKANTH
    1 year
    # text 0.13 KB | 0 0
    1. 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