Re: Wave trend Oscillator coding

67
mrtools wrote: Fri Mar 08, 2024 10:51 am If when you get a chance could you please post the code you are using and will see if I can make them the same?
Hi Mr Tools, I think the indicator code that the friend above mentions is this one:

//
// @author LazyBear
//
// If you use this code in its original/modified form, do drop me a note.
//
study(title="WaveTrend [LazyBear]", shorttitle="WT_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 = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)

wt1 = tci
wt2 = sma(wt1,4)

plot(0, color=gray)
plot(obLevel1, color=red)
plot(osLevel1, color=green)
plot(obLevel2, color=red, style=3)
plot(osLevel2, color=green, style=3)

plot(wt1, color=green)
plot(wt2, color=red, style=3)
plot(wt1-wt2, color=blue, style=area, transp=80)



but I have the impression that I have already seen the Wave Trend Oscillator here.
These users thanked the author RodrigoRT7 for the post:
mrtools

Re: Wave trend Oscillator coding

68
mrtools wrote: Fri Mar 08, 2024 10:51 am If when you get a chance could you please post the code you are using and will see if I can make them the same?

Code: Select all

//
// @author LazyBear
//
// If you use this code in its original/modified form, do drop me a note. 
//
study(title="WaveTrend [LazyBear]", shorttitle="WT_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 = hlc3 
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
 
wt1 = tci
wt2 = sma(wt1,4)

plot(0, color=gray)
plot(obLevel1, color=red)
plot(osLevel1, color=green)
plot(obLevel2, color=red, style=3)
plot(osLevel2, color=green, style=3)

plot(wt1, color=green)
plot(wt2, color=red, style=3)
plot(wt1-wt2, color=blue, style=area, transp=80)
These users thanked the author andrewstone for the post:
mrtools
Yeshua is Lord

Re: Wave trend Oscillator coding

70
andrewstone wrote: Fri Mar 08, 2024 3:15 pm If you figure it out. Could you add a colored histogram when only the green line closes above or below the middle level? Thanks in advance.
Went over the code again and code wise they are the same all I can figure out either it's the broker's feed difference or maybe the pine script ma's are figured a little differently, anyway just in case did the histogram mod you requested which IMHO was a nice idea.
These users thanked the author mrtools for the post (total 3):
RodrigoRT7, andrewstone, kvak


Who is online

Users browsing this forum: DotNetDotCom [Bot] and 21 guests