UNPKG

trading-signals

Version:

Technical indicators to run technical analysis with JavaScript / TypeScript.

19 lines 624 B
import { IndicatorSeries } from '../../base/Indicator.js'; export class BollingerBandsWidth extends IndicatorSeries { bollingerBands; constructor(bollingerBands) { super(); this.bollingerBands = bollingerBands; } getRequiredInputs() { return this.bollingerBands.getRequiredInputs(); } update(price, replace) { const result = this.bollingerBands.update(price, replace); if (result) { return this.setResult((result.upper - result.lower) / result.middle, replace); } return null; } } //# sourceMappingURL=BollingerBandsWidth.js.map