This indicator is nothing else than the classical Williams oscillator, set to 5 and 35, BUT with the addition of those signal bands above and below 0.
Here is a formula inspired from an AFL for Amibroker and converted into PRT language; those bands are supposed to indicate an acceleration up/down when prices break above the upper band or below the lower band, and a loss of volatility when it stays in between. Also, in term of Elliott Wave, it also helps to point when a W4 correction is over, when prices retrace over 80% of their previous peak (trough) aka close or even beyond zero.
Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
defparam calculateonlastbars = 4000 // --------------- BobStrength = 5 oscfast = 35 oscslow = 100 // --------------- if barindex>oscslow then MP=(High+Low)/2 OscAG= average[oscfast](MP)-average[oscslow](MP) Lens=Oscfast+Oscslow Pr = 2.0/Lens //once uprline = OscAG //once lwrline = OscAG if OscAG>0 then UprLine = OscAG*pr+UprLine[1]*(1-pr) LwrLine = LwrLine[1] r=0 g=255 else UprLine = UprLine[1] LwrLine = OscAG*pr+LwrLine[1]*(1-pr) r=255 g=0 endif endif return OscAG as "AGet OSc" style(histogram) coloured(r,g,0), uprline+(BobStrength/100)*UprLine as "Upr", lwrline-(BobStrength/100)*LwrLine as "Lwr" |
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
Thank you
Improving performance
origin in line 17 –> if OscAG > 0 then
adding –> if (OscAG + volume) / volume > 0 then
Yes, that’s better