Stochastic Momentum Index (SMI)

An advancement for the Stochastic Oscillator. Note that you might need at least data with * length of at least double period in order to have the latest records more accurate.

import { Ticker, TechnicalAnalysisLibrary } from 'traders';

const ticker = new Ticker('V');

const data = await ticker.historical('1d', '2021-02-01', '2021-03-13');

const ta = new TechnicalAnalysisLibrary();

try {
  const result = ta.SMI(10, 3, data);
} catch (error) {
  console.log(error);
}
# Example of SMI result
# Visa daily closing price from 2021-02-01 to 2021-03-13
# Value ranges from -40 to 40
[
  32.25, 28.68, 32.12, 35.03,
  32.49, 27.65, 25.44, 13.06,
   8.88, 14.53, 26.57, 23.77,
  17.28, 18.72, 20.08, 19.71,
  14.15, 14.42, 16.03, 16.64,
  20.81, 26.82, 29.14
]

Last updated