xmd79

Elliott Wave 3 Finder_v2

May 25th, 2023
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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. // created by Chris Guthrie © StonkSignaler
  3. // I have added an input field for uesers to determine the last n bars to consider for highest highs and lowest lows
  4. // July 13, 2022
  5. // @version=5
  6. //
  7. indicator(title = "Elliott Wave 3 Finder_v2", shorttitle="EW_3_v2")
  8. n_bars = input(50, "Consider how many bars?")
  9.  
  10. inp = input(close)
  11.  
  12. math_diff = ta.ema(inp, 5) - ta.ema(inp, 35)
  13. myColor = math_diff >= 0 ? color.lime : color.red
  14.  
  15. // Extremes
  16. theTop = ta.highest(math_diff, n_bars) == math_diff and math_diff > 0
  17. theBot = ta.lowest(math_diff, n_bars) == math_diff and math_diff < 0
  18.  
  19.  
  20. // Plots
  21. plot(math_diff, color = myColor, style = plot.style_histogram, linewidth = 3)
  22. bgcolor(theTop ? color.new(#87cefa, 50) : na)
  23. bgcolor(theBot ? color.new(#ff00ff, 50) : na)
Advertisement
Add Comment
Please, Sign In to add comment