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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
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!
You obviously made a mistake somewhere, I believe you made a “CALL”? You should copy/paste the whole indicator code into your automated trading strategy instead.
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
This website is dedicated to prorealtime trading platform. But you can ask others platforms coding as private job through the programming services: trading programming services