portfolio-management
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

portfolio-management

Different calculations to analyse portfolio.

npm install portfolio-management --save

  • CLI:
const { analyseMyPortFolioCli } = require("portfolio-management");

analyseMyPortFolioCli("path-to-csv.csv", "zerodha")

Screenshot 2022-10-16 at 10 13 40 PM

  • API:
const { analyseMyPortFolio } = require("portfolio-management");

async function calcIt() {
  console.log(await analyseMyPortFolio("path-to-csv.csv", "zerodha"))
}

calcIt();
{
  totalInvestment: 52863,
  portfolio: 58289.5,
  statistics: [
    {
      name: 'COALINDIA',
      qty: '75',
      avg: '211',
      marketPrice: '236.35',
      weightage: '30.41%',
      return: '1901.25'
    },
    {
      name: 'COCHINSHIP',
      qty: '30',
      avg: '419.1',
      marketPrice: '521.8',
      weightage: '26.86%',
      return: '3081.00'
    },
    {
      name: 'GAIL',
      qty: '175',
      avg: '85.8',
      marketPrice: '85.15',
      weightage: '25.56%',
      return: '-113.75'
    },
    {
      name: 'GHCL',
      qty: '15',
      avg: '630',
      marketPrice: '667.2',
      weightage: '17.17%',
      return: '558.00'
    }
  ]
}

Note:

  • Zerodha holdings only awaitlable for now.
  • WIP: Groww and brokers parsing

Package Sidebar

Install

npm i portfolio-management

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

18 kB

Total Files

16

Last publish

Collaborators

  • ashvin