Package Exports
- series-processing
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (series-processing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.