This is a ProBuilder code for the “Ultimate Oscillator” included in the standard PRT indicator repertory.
With this code, the Ultimate Oscillator can be used in backtests and automated trading systems.
The Ultimate Oscillator developed by Larry Williams is a smoothed RSI averaging one standard RSI and two other RSIs with doubled and fourfold period length.
The lower indicator in the chart displayed is the manually coded version, the indicator above is the standard version of the PRT platform. Both deliver identical results. In the standard version, the period length cannot be changed and is always fixed to 7.
//Ultimate Oscillator by Larry Williams
BuyPressure = close - min(low, close[1])
TrueRange = TR
per = 7
avper = summation[per](BuyPressure) / summation[per](TrueRange)
avper2 = summation[per * 2](BuyPressure) / summation[per * 2](TrueRange)
avper4 = summation[per * 4](BuyPressure) / summation[per * 4](TrueRange)
UltimateOscillator = 100 * ((4 * avper) + (2 * avper2) + avper4) / 7
lowerline = 30
upperline = 70
return UltimateOscillator coloured(0,0,0), lowerline coloured(0,0,255) as "lower line", upperline coloured(0,0,255) as "upper line"