IBFlexStatementExtractor: Cash xacts: Properly deal with diff. currency pairs#4792
IBFlexStatementExtractor: Cash xacts: Properly deal with diff. currency pairs#4792pfalcon wants to merge 1 commit into
Conversation
…cy pairs There can be different currency pairs, e.g. EUR.USD vs USD.CAD, and it can be exchanged in one or another direction.
| // If "quantity" is negative, then we're dealing with pair like | ||
| // USD.CAD, exchanging USD to CAD, or maybe EUR.USD, exchanging | ||
| // EUR to USD. | ||
| if (targetAmount.startsWith("-")) |
There was a problem hiding this comment.
Can you contribute an example where the targetAmount does not start with a "-"?
Because all examples we have is buySell="SELL".
And then it sounds to me that is the more reasonable attribute to use to determine the source and target pair.
If it is "SELL", and the symbol is "EUR.USD" then it is EUR is source and USD is target.
If it is "BUY" (but I do not have an example, and the symbol is "EUR.USD", then USD is the source and EUR the target.
There was a problem hiding this comment.
buySell=
And then it sounds to me that is the more reasonable attribute to use to determine the source and target pair.
I can confirm that this will work too. Preparing example may take some time though.
|
merged and adapted as discussed in #4782 |
There can be different currency pairs, e.g. EUR.USD vs USD.CAD, and it can be exchanged in one or another direction.