Advertisement
xmd79

Dominant Direction

Jan 13th, 2023
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © peacefulLizard50262
  3.  
  4. //@version=5
  5. indicator("Dominant Direction", overlay = true, max_bars_back = 5000)
  6. import lastguru/DominantCycle/2 as d
  7.  
  8. source = input.source(hl2, "Source")
  9. colour = input.color(color.orange, "Color")
  10. length = d.mamaPeriod(source, 2, 4096)
  11. lines = line.new(bar_index, source, bar_index, source)
  12. if barstate.islast
  13. lines := line.new(bar_index, source , bar_index + int(length), source + (source-source[int(length)]), color = colour, style = line.style_arrow_right)
  14. if barstate.isconfirmed
  15. line.delete(lines)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement