Appearance
SMI Ergodic Oscillator
SMI Ergodic minus its signal, as a histogram.
Kind indicator · Drawn in its own pane
Try it
On the chart, press / and choose SMI Ergodic Oscillator under Oscillators. To change it, copy the source below into the AlphaScript editor.
Inputs
| Input | Type | Default |
|---|---|---|
| Long length | int | 20 |
| Short length | int | 5 |
| Signal line length | int | 5 |
| Above zero | color | "#26A69A" |
| Below zero | color | "#FF5252" |
Source
From packages/alphascript/indicators/smio.as.js.
js
indicator({ name: "SMI Ergodic Oscillator", shortTitle: "SMIO", overlay: false, precision: 4 });
const longLength = input.int("Long length", 20, { min: 1 }), shortLength = input.int("Short length", 5, { min: 1 }), signalLength = input.int("Signal line length", 5, { min: 1 });
const erg = ta.tsi(candle.close, shortLength, longLength);
plot(ta.calc([erg, ta.ema(erg, signalLength)], (e, s) => e - s), { title: "SMI Ergodic Oscillator", style: "columns",
colorUp: input.color("Above zero", "#26A69A", { group: "Style" }), colorDown: input.color("Below zero", "#FF5252", { group: "Style" }) });