Advertisement
xmd79

Sine Wave pine

Jan 12th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. //@version=5
  2. indicator('Sine Wave', overlay=false)
  3. // Define amplitude, frequency, and phase
  4. pi = 3.14159
  5. amplitude = 50
  6. frequency = 2 * pi / 20
  7. phase = 0
  8.  
  9. inp = input(close)
  10. // Generate sine wave
  11. sine_wave = amplitude * math.sin(frequency * inp + phase)
  12. // Plot sine wave on price chart
  13. plot(sine_wave, color=color.new(color.red, 0), linewidth=2)
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement