Advanced Get Oscillator

Category: Indicators By: carlvan Created: June 30, 2022, 8:06 AM
June 30, 2022, 8:06 AM
Indicators
4 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: 167
carlvan Average
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

Logo Logo
Loading...