Advertisement
xmd79

Function Sine Wave RicardoSantos

Jan 11th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //@version=5
  2. indicator(title='Function Sine Wave')
  3. wave_height = input(100)
  4. wave_duration = input(50)
  5.  
  6. f_sine_wave_1(_wave_height, _wave_duration) =>
  7. _pi = 3.14159265359
  8. _w = 2 * _pi / _wave_duration
  9. _sine_wave = _wave_height * math.sin(_w * bar_index)
  10. _sine_wave
  11.  
  12. wave = f_sine_wave_1(wave_height, wave_duration)
  13. wave2 = f_sine_wave_1(wave_height, close)
  14. plot(series=wave, title='Normal', color=color.new(color.black, 0))
  15. plot(series=wave2, title='Price as cycle duration', color=color.new(color.red, 0))
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement