WaveTrend Oscillator is a port of a famous TS/MT indicator. More info: https://www.youtube.com/watch?v=7vhIsk51_Ro
When the oscillator is above the overbought band (red lines) and crosses down the signal (dotted line), it is usually a good SELL signal. Similarly, when the oscillator crosses above the signal when below the Oversold band (green lines), it is a good BUY signal.
//converted from pinescript indicator by request on forum : http://www.prorealcode.com/topic/new-prorealtime-indicator-wave-oscillator-by-lazybear/
(description above from TV).
n1 = 10 //Channel Length
n2 = 21 //Average Length
obLevel1 = 60 //Over Bought Level 1
obLevel2 = 53 //Over Bought Level 2
osLevel1 = -60 //Over Sold Level 1
osLevel2 = -53 //Over Sold Level 2
ap = medianprice
esa = exponentialaverage[n1](ap)
apesa = abs(ap - esa)
d = exponentialaverage[n1](apesa)
ci = (ap - esa) / (0.015 * d)
tci = exponentialaverage[n2](ci)
wt1 = tci
wt2 = average[4](wt1)
RETURN 0 as "0", oblevel1 as "overbought level1", oblevel2 as "overbought level2", oslevel1 as "oversold level1", oslevel2 as "oversold level2", wt1 coloured(0,200,0) as "wt1", wt2 coloured(200,0,0) as "wt2", wt1-wt2 coloured(0,0,200) as "difference"
You must be logged in to post a comment.
Hi,
I'm making a strategy with this indicator for entry and sometimes exit signals. The backtest works fine, but when activated for automatic trading it gets stopped out because of an error. Saying it has uses "a negative or zero offset (ex: close[-10]) during the evolution of the last candlestick."
What can be the problem you think?
Thanks!
Yes. I made a call function and change that indicator so it included dynamic variables for clean code and easy backtesting of different values. Your solution works! But the code gets messy this way – this indicator is pretty simple but is there a way to have the call function without getting this error? Mostly thinking of my future coding.
Hi, is there an MT4 version of this indicator available? Thanks