capital-gains | Capital gains calculator | Apps library
kandi X-RAY | capital-gains Summary
kandi X-RAY | capital-gains Summary
Capital gains calculator
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return a formatted string representation of the graphs
- Tabulate a list of closed slots
- Format a table of open slots
- Takes a pandas dataframe and returns a formatted table
- Formats a list of open slots
- Format table
- Formats a decimal value
- Process sell sell orders
- Get argument parser
- Load transactions from a CSV file
capital-gains Key Features
capital-gains Examples and Code Snippets
usage: capital-gains [] [--]
Capital gains calculator
optional arguments:
-h, --help show this help message and exit
-d , --decimal-places
round $ to decimal places (default: 0)
-s , --shares-decimal-plac
pip install capital-gains
brew install nkouevda/nkouevda/capital-gains
Community Discussions
Trending Discussions on capital-gains
QUESTION
Does any one knows older version of "capital-gains" python library. This support python3.9+ version.
Or any other python library that i can use for capital gains calculation. Can anyone help me?
...ANSWER
Answered 2021-Dec-09 at 05:27Just check all available versions in pip repository
And check release history for capital-gains
After that check release history for python
First version of capital-gains
released at May 2018. Same as Python 3.7.0
So if you using Python 3.7.0
or newer you may install older version by using pip install capital-gains==1.0.0
(or newer)
If your python is older, these alternatives may be useable (I don't know what is capital-gains
and just leave google suggestion here)
QUESTION
I have a Google Sheet (Excel formulas apply) containing 2000 transactions that are structured like below:
Link to Google Sheet with example calcs here.
I need to calculate the Profit (ie. FIFO Capital Gains) for every sell order and place this amount in the 5th column (as pictured). This can be achieved with either traditional formulas or with a Google App Script. Preferably in Google Sheets.
I'm finding it difficult via formulas to match the sell order with the buy as you proceed down the table as some sell orders are split across multiple buy lines. If anyone could help with a formula or solution to tackle this problem it would be much appreciated. This is an updated question to the original here.
...ANSWER
Answered 2021-Jun-13 at 10:44Screenshot below refers:
Google sheets here
IMPORTANT UPDATE: re: 2000+ rows, see link in my last comment (for OneDrive template, s.t. expiry, and bottom of this proposal for screenshot of error "too large to import")
fyi: (Office 365 - Excel - fns. such as 'filter' etc., so #Name! will be ubiquitous upon opening this link; however, sharing this should serve as a convenient means to replicate above screenshot in the correct version of Excel)
REQUIREMENTS- Office 365
- Adequate space to the right or ability to utilise extra sheet for calcs as req.
High-level | Take-aways
• Relies on 2 additional tables: Qty 'depletion' table (here - G:P) and corresp. Profit Vectors (here - R:Z)
• Compressed representations (2x2 tables, per Summary Tables, here: rows 19:32) could be explored to simplify matters (albeit these are still Work in Progress ['WiP'])
• VB could be attractive alternative too
Low-level | Procedural
- Single-cell function could not be found without exceptional complication (however, suspect it could be possible e.g. using FilterXML?)
- Qty label transposes filtered negative quantities (grey shaded, G3: J3)
- These values are depleted in turn (from left to right, i.e. dependency on having data sorted in ascending order by date (in this depiction, data first sorted by 'fruit' as these are assumed to be independent in the context of the profit calc.)
- For example, -5 quantity (G3) offset by +10 (B3) to yield +5 which, in turn contributes towards the -35 qty (H3) to yield -30. No further contribution can be made (left to right); next row (5): +20 avail (given), no offset against -5 (G3, already 'reimbursed', so 20 offset against -30 (H4) to yield -10, and so forth.
- Worksheet set up to accommodate longer list of fruit / profits
- Result table of residual 'quantities' (~ G:J) applied to price differential to yield 'profit vectors' (R:U) which are summed against corresponding negative quantities to produce Profit score (yellow shaded cells)
Salient functions (all of which should be available within Google Sheet, but for completeness):
1) Profit calc. (E4, drag down):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install capital-gains
You can use capital-gains like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page