1.0.7 • Published 2 years ago

portfolio-management v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

portfolio-management

Different calculations to analyse portfolio.

npm install portfolio-management --save

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

analyseMyPortFolioCli("path-to-csv.csv", "zerodha")
  • 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