Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- //
- // @author LazyBear @author LazyBear @author LazyBear @author LazyBear @author LazyBear
- //
- // If you use this code in its original/modified form, do drop me a note.
- indicator(title='WaveTrend with Crosses [LazyBear]', shorttitle='WT_CROSS_LB')
- n1 = input(10, 'Channel Length')
- n2 = input(21, 'Average Length')
- obLevel1 = input(60, 'Over Bought Level 1')
- obLevel2 = input(53, 'Over Bought Level 2')
- osLevel1 = input(-60, 'Over Sold Level 1')
- osLevel2 = input(-53, 'Over Sold Level 2')
- ap =input(hlc3)
- esa = ta.ema(ap, n1)
- d = ta.ema(math.abs(ap - esa), n1)
- ci = (ap - esa) / (0.015 * d)
- tci = ta.ema(ci, n2)
- wt1 = tci
- wt2 = ta.sma(wt1, 3)
- plot(0, color=color.new(color.gray, 0))
- plot(obLevel1, color=color.new(color.red, 0))
- plot(osLevel1, color=color.new(color.green, 0))
- plot(obLevel2, color=color.new(color.red, 0))
- plot(osLevel2, color=color.new(color.green, 0))
- plot(wt1, color=color.new(color.green, 0))
- plot(wt2, color=color.new(color.red, 0))
- plot(wt1 - wt2, color=color.new(color.blue, 80), style=plot.style_area)
- plot(ta.cross(wt1, wt2) ? wt2 : na, color=color.new(color.black, 0), style=plot.style_circles, linewidth=3)
- plot(ta.cross(wt1, wt2) ? wt2 : na, color=wt2 - wt1 > 0 ? color.red : color.lime, style=plot.style_circles, linewidth=2)
- barcolor(ta.cross(wt1, wt2) ? wt2 - wt1 > 0 ? color.aqua : color.yellow : na)
Advertisement
Add Comment
Please, Sign In to add comment