Back to Community
Problems with implementing a signal

Hey everybody :),
I am new here and I have some troubles with implementing the "WaveTrend Oscillator - Signal". It is a really interesting signal, which we talked about in a class at my university. I want to adopt this code and invest into the Nike Stocks (NKE). So, my problems are:
- Which language is this? How do I translate it into python?
- Which time period do I need for the ema and the average price in this signal?
- How can I set the overbought and oversold areas?

I would be very happy if somebody could help me. Thank you in advance!

This is the signal, which you can find at tradingview.com:

// @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)


You can find the signal here: WaveTrend Oscillator

2 responses

Hi. This is written in Pine.

I've also been looking at this indicator. Sorry that is all I can help, maybe someone else can help also further this?

Hi Mike,
thank you for your answer. At least, I know now the language.