Calculates Capital Gains for US stocks based on the Indian process. Fetches data from Google Spreadsheets and scrapes relevant data from other places.
Pre-Processing
- Fetch Transaction History from Spreadsheet and save.
- Fetch CII data and save.
- Find stocks sold in the current financial year
- Get the stock split history for each such stock
- For each such stock sold calculate capital gains
Capital Gains Calculation
- Inputs (for 1 stock):
- Complete transaction history
- Split history
- Currency Conversion Rates
- Adjust for Stock Splits
- Increase quantity
- Decrease price
- Adjust for previous sales - FIFO
- Compute new table:
- Quantity Sold
- Selling Price
- Cost Price
- Convert into INR
- Adjust with Indexation (CII ratios)
Questions
- What happens in case of mergers and acquisitions?
$ poetry shell
$ poetry install
$ python3 main.py --date 2024-03-01 --debug --owner DC --skip GOOG GOOGL HDFC