series-processing
v0.1.14
Published
Time-series processing for forex, market analysis, including MA, EMA,...
Downloads
7
Maintainers
Readme
series-processing
Time-series processing for forex, market analysis, including SMA, EMA, MACD...
Install
NPM
npm intall --save series-processing
Yarn (Recommended)
yarn add series-processing
Example
Simple with studyBuilder
const { TimeSeries, studyBuilder } = require('../lib');
const series = new TimeSeries();
series.map(studyBuilder.EMA('ema1', 'close', 2));
series.initData(data); // data: Array of candle object
console.log(series.getDataSeries()); // Print result: Array of transformed candle object
More studyBuilder can found here
Multiple studies with same series
const series = new TimeSeries();
series.map(studyBuilder.EMA('ema1', 'close', 2));
series.map(studyBuilder.SMA('sma1', 'open', 4));
series.map(studyBuilder.EMA('ema2', 'sma1', 5));
OR with array
const series = new TimeSeries();
series.map([
studyBuilder.EMA('ema1', 'close', 2),
studyBuilder.SMA('sma1', 'open', 4),
studyBuilder.EMA('ema2', 'sma1', 5)
]);
Custom study
const series = new TimeSeries();
series.map((lastPoint) => {
return { 'avg' : (lastPoint['open'] + lastPoint['close']) / 2 }
});
API Reference
API docs is coming soon.
License
MIT License.