Advanced Get Oscillator

Category: Indicators By: carlvan Created: June 30, 2022, 8:06 AM
June 30, 2022, 8:06 AM
Indicators
3 Comments

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:

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"

Download
Filename: Williams-Oscillator-with-Bands.itf
Downloads: 166
carlvan Average
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

Logo Logo
Loading...