Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielr18/fintual-portfolio
Stocks Portfolio Tracker - Powered by Fintual
https://github.com/danielr18/fintual-portfolio
Last synced: about 1 month ago
JSON representation
Stocks Portfolio Tracker - Powered by Fintual
- Host: GitHub
- URL: https://github.com/danielr18/fintual-portfolio
- Owner: danielr18
- Created: 2019-01-12T13:39:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-20T07:21:55.000Z (about 1 month ago)
- Last Synced: 2024-12-20T08:25:28.188Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://fintual-portfolio.netlify.com
- Size: 2.41 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 89
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stocks Portfolio Tracker - Powered by Fintual
A JavaScript module to help with calculations of stocks and portfolios in an object oriented way. Stocks data is obtained from [Fintual API](https://fintual.cl/api-docs).
## Usage
```js
(async function() {
// Previous transactions in the portfolio
const transactions = [{ date: '2018-08-01', quantity: 10, stockId: '187' }];// Build the portfolio.
const portfolio = new Portfolio(transactions);
// Initialize the stocks data
await portfolio.init();
// Add more transactions
await portfolio.addTransaction('2018-12-01', '187', 15);
// Calculate the profit
const profit = await portfolio.profitOnPeriod('2018-08-01', '2018-12-01');
const annualizedProfit = await portfolio.annualizedProfitOnPeriod('2018-08-01', '2018-12-01');
console.log(profit, annualizedProfit);
})();
```## Example
Check out [example app](/example_app).Demo: https://fintual-portfolio.netlify.com
## API
To be documented, meanwhile check out [Portfolio](/src/Portfolio.js) and [Stock](/src/Stock.js).