The Ultimate Oscillator is a momentum oscillator that combines short, intermediate, and long-term price action into one value.
UO = 100 × (4 × avg7 + 2 × avg14 + avg28) / (4 + 2 + 1)
- avgN = sum(BP, N) / sum(TR, N)
- BP = Close − min(Low, PrevClose)
- TR = max(High, PrevClose) − min(Low, PrevClose)
period1(default: 7): Short periodperiod2(default: 14): Medium periodperiod3(default: 28): Long period
import { UltimateOscillator } from '../src/ultimate-oscillator';
const uo = new UltimateOscillator();
const result = uo.nextValue(high, low, close);
// result: Ultimate Oscillator valueA single number: the Ultimate Oscillator value for the current input.