Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © peacefulLizard50262
- //@version=5
- indicator("sinusoidal_hpf")
- sinusoidal_hpf(_series, _period, _phase_shift) =>
- ma = 0.0
- for i = 0 to _period - 1
- weight = math.sin(i * 2 * math.pi / _period + _phase_shift * math.pi / 180)
- ma := ma + weight * _series[i]
- ma / _period
- source = input.source(close, "Source")
- length = input.int(10, "Length", 1)
- shift = input.float(0, "Phase Shift", 0, 360, 0.5)
- plot(sinusoidal_hpf(source, length, shift), "Sinusoidal High Pass Filter", color.new(color.purple, 10))
- plot(0, "0", color.silver)
Advertisement
Add Comment
Please, Sign In to add comment