Giter VIP home page Giter VIP logo

wash-sale-calculator's Introduction

wash-sale-calculator

Calculator for wash sales for US taxes

Note that the author is not a CPA or tax expert. This program most certainly contains bugs.

To use, you'll need a CSV file with the initial state. I've provided a dummy one called dummy_example.csv.

To use the program from a terminal, run:

python wash.py -w dummy_example.csv -o out.csv

The csv file must have one buy or buy-sell trade per row. Each row has the following columns:

ColumnHeader Type Description
Cnt integer # of shares in this lot
Sym string stock symbol. Note that all symbols are considered substantially identical to each other, so if you trade in multiple stocks that aren't substantially identical, feed them into the calculator separately.
Desc string description provided on 1099b or statement. Unused by this program, but carried through for your records
BuyDate date (mm/dd/yyyy) Date lot purchased
Basis floating point number Acquisition price or basis. Value is typically share price on BuyDate * Cnt
SellDate date (mm/dd/yyyy) Optional. If sold, the date of sale
Proceeds floating point number Optional. If sold, proceeds. Value is typically share price on SellDate * Cnt - fees
AdjCode string Optional. Must be empty for the input. May be set to W if there's a wash sale. This would go into the IRS form 8949.
Adj floating point number Optional. Applies only if sold. Value is amount of loss disallowed. Input must have this set to 0. Output value may go onto IRS form 8949.
FormPosition string Optional but recommended. Useful for tracking this lot. When a lot is split, it will have '.1' or '.2' appended. Recommended is to enumerate all lines in your 1099b and use that number here. E.g., "Line 1" for the first lot on the 1099b.
BuyLot string Optional. Generally can be left blank. If two lots were acquired as part of the same buy order, put the same value here. This may occur if you bought a lot of stock, then sold off the lot in pieces (each piece would get a new line on the 1099b); if the broker automatically divided your buy order into pieces to execute; or if other factors caused the broker to split one buy lot into multiple lines on the 1099b. (This field is used because shares from a given buy lot can't replace shares from the same buy lot in a wash sale)
IsReplacement bool (True/False) Optional (left blank = False). This is set to true when the lot is used as a replacement in a wash sale. Since a lot may only be used as a replacement once, you can prevent a lot from absorbing a loss in wash sale computation by setting this to true.

If you commit changes to this software, make sure all tests are passing. To verify that all the tests pass:

python run_tests.py

wash-sale-calculator's People

Contributors

adlr avatar drheld avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.