mirror of
https://github.com/farcasclaudiu/xtb-investment-tools.git
synced 2026-06-22 05:01:57 +03:00
68cfec926e
- Created requirements.txt for dependencies including pandas, numpy, openpyxl, and yfinance. - Added setup-env.sh script to set up a Python virtual environment and install required packages. - Introduced validate-export.sh script to validate the exporter module and check expected fields. - Implemented test cases in test_portfolio_performance_exporter.py to ensure correct CSV export functionality and data handling.
3.1 KiB
3.1 KiB
Portfolio Performance CSV Mapping
Load this when validating or explaining XTB to Portfolio Performance exports.
Generated Files
<stem>_portfolio_performance_portfolio_transactions.csv- Import type:
Portfolio Transactions - Header:
Date;Type;Shares;Ticker Symbol;Security Name;Value;Fees;Taxes;Note;Securities Account;Cash Account
- Import type:
<stem>_portfolio_performance_account_transactions.csv- Import type:
Account Transactions - Header:
Date;Type;Value;Ticker Symbol;Security Name;Shares;Gross Amount;Currency Gross Amount;Note;Cash Account;Offset Account
- Import type:
Both files are UTF-8 CSV files with semicolon delimiters and a first-line header.
Portfolio Performance's UI uses Deposit Accounts for cash/deposit accounts
and Securities Accounts for custody accounts. The CSV importer still names
the deposit-account field Cash Account; keep that header literal.
XTB To Portfolio Performance Mapping
Stock purchaseorOPEN BUY-> PortfolioBuyStock sale,Stock sell,CLOSE SELL, orOPEN SELL-> PortfolioSellStock sellwithCLOSE BUY-> PortfolioSellDeposit-> AccountDepositWithdrawal-> AccountWithdrawalDividend-> AccountDividendDividend tax,RO tax,Free funds interest tax, or other tax-like rows -> AccountTaxesFree funds interest-> AccountInterestCurrency conversion-> AccountFeesSubaccount transferorTransfer-> AccountTransfer (Inbound)orTransfer (Outbound)by amount sign
Import Steps
- In Portfolio Performance, create or open the target portfolio file.
- Ensure the Portfolio Performance
Securities AccountandDeposit Accountexist, or select/create them in the import wizard. The default CSV names areXTBandXTB (<CCY>). - Import the portfolio transactions CSV first with
File > Import > CSV files. - Select type
Portfolio Transactions. - Use
UTF-8, delimitersemicolon, and enableFirst line contains header. - Confirm mappings for
Date,Type,Shares,Ticker Symbol,Security Name,Value,Fees,Taxes,Securities Account, andCash Account. In the CSV importer,Cash Accountmaps to the Portfolio Performance deposit account. - Finish that import and resolve any security matching prompts.
- Import the account transactions CSV with
File > Import > CSV files. - Select type
Account Transactions. - Use the same CSV settings:
UTF-8, semicolon delimiter, first line header. - Confirm mappings for
Date,Type,Value,Ticker Symbol,Security Name,Shares,Gross Amount,Currency Gross Amount,Cash Account, andOffset Account. In the CSV importer,Cash Accountmaps to the Portfolio Performance deposit account. - Review the preview/status column before finishing, especially transfers, taxes, and dividends.
Limitations
- The exporter does not create Portfolio Performance
.xmlportfolio files. - It does not generate Portfolio Performance JSON import configurations.
- Multi-currency gross amount and exchange-rate fields are left blank unless a future XTB mapping can populate them safely.