Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set misreports profit and the earliest date since which they were made. #31

Open
dscotese opened this issue Apr 17, 2023 · 2 comments
Open

Comments

@dscotese
Copy link
Owner

This is a known bug that I have not fixed. I believe it's due to settling margin trades which causes them to be reported twice.

@dscotese
Copy link
Owner Author

I think the fix is to filter the results from ClosedOrders to exlcude those with descr.ordertype "settled-position".

@dscotese
Copy link
Owner Author

dscotese commented Aug 8, 2024

I don't think this is worth fixing because set should not be trying to report profits anyway. Since many users will want to list the trades for their taxes, a separate feature should be to identify sells and follow some simple rule for calculating the capital gain or loss for each one. The asset command should trigger a request for an updated cost basis for whichever assets get their "off-exchange" amounts updated. A solution I'm working on is a "roundTrips" feature, which will explicitly indicate that it under-reports profits by ignoring trades that have not "round-tripped" yet as well as all trades that aren't expected to be closed profitably by the bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant