MongoDB Financial Chart - MFChart
MFChart is a promise based TypeScript library to store financial time
series data using MongoDB database. The library is designed for very specific
use case, though it can be used as a general for storing time series data.
Imagine you have investment portfolios and you would like to have charts
(1 day, 1 week, 1 month, 3 months,...) for every single portfolio. MFChart
addresses this particular issue by using MongoDB database.
For now, MFChart provides 1 day, 1 week, 1 month, 3 months and
1 year charts with following intervals:
- 1 day in 5 minutes intervals.
- 1 week in 30 minutes intervals.
- 1 month in 2 hours intervals.
- 3 months in 12 hours intervals.
- 1 year in 1 day intervals.
How to Install?
Before installing the project make sure you already installed minimum
requirements: TypeScript Compiler (tsc) and MongoDB.
npm i mfchart
How to Import and Creat a MFChart Object?
import MFChart from 'mfchart';
const db =
const chart = new MFChart(db, 'coll_name');
MFChart Public Methods
async updateAllCharts(id, value, name);
async updateChart(type, id, value, name);
async getChartData(type, id)
deleteCharts(id)
Example
Please take a look at the
tests.mjs
file for a simple example.
Contributions
Contributions are welcome and can be made by submitting GitHub pull requests to
this repository. In general, the MFChart source code follows
Airbnb JavaScript Style Guide and the
rules specified in .eslintrc.json file.
License
This source code is available to everyone under the standard
MIT LICENSE.