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

Importing dividends in different currency from security (Interactive Brokers Flex Query) #2139

Closed
delianenchev opened this issue Mar 7, 2021 · 3 comments
Labels

Comments

@delianenchev
Copy link

delianenchev commented Mar 7, 2021

I have the following error when importing a Flex Query: Exchange rate of gross value is missing (transaction currency USD and security currency EUR). Flex Query have fxRateToBase
Image

First import Trades.xml

<FlexQueryResponse queryName="Trades" type="AF"> <FlexStatements count="1"> <FlexStatement accountId="UXXXXXX" fromDate="20190826" toDate="20191231" period="LastBusinessDay" whenGenerated="20210307;043303"> <Trades> <Trade accountId="UXXXXXX" acctAlias="" model="" currency="EUR" fxRateToBase="1" assetCategory="STK" symbol="SGN" description="SURGUTNEFTEGAS-SP ADR" conid="27346611" securityID="US8688612048" securityIDType="ISIN" cusip="" isin="US8688612048" listingExchange="SWB" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" tradeID="2592275115" putCall="" reportDate="20191030" principalAdjustFactor="" dateTime="20191030;091642" tradeDate="20191030" settleDateTarget="20191101" transactionType="ExchTrade" exchange="TGATE" quantity="120" tradePrice="6" tradeMoney="720" proceeds="-720" taxes="0" ibCommission="-6" ibCommissionCurrency="EUR" netCash="-726" closePrice="5.965" openCloseIndicator="O" notes="" cost="726" fifoPnlRealized="0" fxPnl="0" mtmPnl="-4.2" origTradePrice="0" origTradeDate="" origTradeID="" origOrderID="0" clearingFirmID="" transactionID="11501005" buySell="BUY" orderReference="" volatilityOrderLink="" exchOrderId="N/A" orderTime="20191030;080542" openDateTime="" holdingPeriodDateTime="" whenRealized="" whenReopened="" levelOfDetail="EXECUTION" changeInPrice="0" changeInQuantity="0" orderType="LMT" traderID="" isAPIOrder="N" accruedInt="0" /> </Trades> </FlexStatement> </FlexStatements> </FlexQueryResponse>

Error is in Cash Transactions.xml

<FlexQueryResponse queryName="Cash Transactions" type="AF"> <FlexStatements count="1"> <FlexStatement accountId="UXXXXXX" fromDate="20200102" toDate="20201231" period="YearToDate" whenGenerated="20210307;045036"> <CashTransactions> <CashTransaction accountId="UXXXXXX" acctAlias="" model="" currency="USD" fxRateToBase="0.83815" assetCategory="STK" symbol="SGN" description="SGN(US8688612048) CASH DIVIDEND USD 0.088051 PER SHARE - RU TAX" conid="27346611" securityID="US8688612048" securityIDType="ISIN" cusip="" isin="US8688612048" listingExchange="SWB" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" dateTime="20200818;202000" settleDate="20200818" amount="-1.58" type="Withholding Tax" tradeID="" code="" transactionID="13505500801" reportDate="20200818" clientReference="" levelOfDetail="DETAIL" /> <CashTransaction accountId="UXXXXXX" acctAlias="" model="" currency="USD" fxRateToBase="0.83815" assetCategory="STK" symbol="SGN" description="SGN(US8688612048) CASH DIVIDEND USD 0.088051 PER SHARE (Ordinary Dividend)" conid="27346611" securityID="US8688612048" securityIDType="ISIN" cusip="" isin="US8688612048" listingExchange="SWB" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" dateTime="20200818;202000" settleDate="20200818" amount="10.56" type="Dividends" tradeID="" code="" transactionID="13505500800" reportDate="20200818" clientReference="" levelOfDetail="DETAIL" /> <CashTransaction accountId="UXXXXXX" acctAlias="" model="" currency="USD" fxRateToBase="0.83815" assetCategory="STK" symbol="SGN" description="SGN(US8688612048) CASH DIVIDEND USD 0.088051 PER SHARE - FEE" conid="27346611" securityID="US8688612048" securityIDType="ISIN" cusip="" isin="US8688612048" listingExchange="SWB" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" dateTime="20200818;202000" settleDate="20200818" amount="-3.67" type="Other Fees" tradeID="" code="" transactionID="13505500802" reportDate="20200818" clientReference="" levelOfDetail="DETAIL" /> </CashTransactions> </FlexStatement> </FlexStatements> </FlexQueryResponse>

Note about fxRateToBase: EUR is the main currency of my account. If I buy a Canadian stock on the US stock exchange, and i get a dividend in CAD. I guess fxRateToBase must be EUR/CAD

  • OS: Windows
  • Version 0.51.1 (Mar 2021
@jonathan-gatard
Copy link

I have the same problem.

@ChrisKolan
Copy link

I can confirm this error.

@jonathan-gatard
Copy link

Yes this issue is still present

Nirus2000 added a commit to Nirus2000/portfolio that referenced this issue Feb 10, 2023
Fixes portfolio-performance#2420
Fixes portfolio-performance#2139
Fixes portfolio-performance#3067
Fixes portfolio-performance#3095
https://forum.portfolio-performance.info/t/interactive-brokers-ungultige-buchungskomponente-fee/9411/2
.... and more
Integration in the ExtractorUtils.java
Refactoring tests, test cases and structure
Completed all missing tests and test cases
and other thinks...
buchen pushed a commit that referenced this issue Apr 8, 2023
* Integration in the ExtractorUtils.java
* Refactoring tests, test cases and structure
* Completed all missing tests and test cases

Issue: #2420
Issue: #2139
Issue: #3067
Issue: #3095
Issue: https://forum.portfolio-performance.info/t/interactive-brokers/276/122
Issue: https://forum.portfolio-performance.info/t/interactive-brokers-ungultige-buchungskomponente-fee/9411/2
Issue: https://forum.portfolio-performance.info/t/interactive-brokers/276/122
Signed-off-by: Nirus2000 <webmaster@nirus-online.de>
[refactored NonImportable to failure message; fixed tests; rebased to master]
Signed-off-by: Andreas Buchen <andreas.buchen@gmail.com>
@buchen buchen closed this as completed Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants