Skip to content

IBFlexStatementExtractor: Cash xacts: Properly deal with diff. currency pairs#4792

Closed
pfalcon wants to merge 1 commit into
portfolio-performance:masterfrom
pfalcon:ibflex-fx-fix
Closed

IBFlexStatementExtractor: Cash xacts: Properly deal with diff. currency pairs#4792
pfalcon wants to merge 1 commit into
portfolio-performance:masterfrom
pfalcon:ibflex-fx-fix

Conversation

@pfalcon
Copy link
Copy Markdown
Contributor

@pfalcon pfalcon commented Jun 19, 2025

There can be different currency pairs, e.g. EUR.USD vs USD.CAD, and it can be exchanged in one or another direction.

…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("-"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

buchen added a commit that referenced this pull request Jun 19, 2025
buchen added a commit that referenced this pull request Jun 19, 2025
buchen added a commit that referenced this pull request Jun 20, 2025
@buchen
Copy link
Copy Markdown
Member

buchen commented Jun 20, 2025

merged and adapted as discussed in #4782

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

Successfully merging this pull request may close these issues.

2 participants