Skip to content

Commit

Permalink
Process trades on same minute in correct order
Browse files Browse the repository at this point in the history
The input file from Cointracking is specified from
newest to oldest. Hence we should reverse the list
before sorting by date for items on the same minute
to occur in correct order.
  • Loading branch information
plilja authored and bitsofwinter committed Mar 31, 2019
1 parent 57a8e9f commit 326620e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions taxdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def indices(col_name):
trades.append(trade)
lineno += 1

trades.reverse()
trades.sort(key=lambda x: x.date)

return Trades(trades)
Expand Down

0 comments on commit 326620e

Please sign in to comment.