Closed raph1900 closed 1 year ago
This library just parses the broker data, it doesn't implement complete trade journal logic. Matching opening basis with closing proceeds is a complex task, and there isn't one right way to do it. I don't know about other jurisdictions, but in the US you can elect different algorithms (FIFO, average cost, specific identification). The best signal you get from IB is in the transaction notes, which will indicate if a different basis-matching algorithm was in effect at the time of the trade. That's already way better than you get from other brokers....
ibflex just gets your data into Python, the processing is up to you. Good luck!
hey. (I edited the questions that why the topic isn't right) I was wondering if there is a way to arrange trades by the open and close. Sometimes a trade is open few days ago meanwhile other trade activity happens, only then a the trade was closed. so I can not find a way to attach the open of a trade with there close.
hope that make sense. thanks!