technicalindicators icon indicating copy to clipboard operation
technicalindicators copied to clipboard

Observable and indicators

Open Bretto opened this issue 6 years ago • 1 comments

How do you plug those indicators with observable? Examples ?

Bretto avatar Jun 28 '19 11:06 Bretto

Don't have to do much.

import { RSI } from 'technicalindicators'

// RxJs 5.x
const obs = getCandlesticks()
  .map((candlesticks) => {
    // ... codes

    const opts = {
      values: candlesticks.map(x => x.close) // Change to whatever the candle structure is
    }
    const rsis = RSI.calculate(opts)

    // ... code
  })

tistaharahap avatar Jul 17 '19 09:07 tistaharahap