mirror of
https://github.com/farcasclaudiu/xtb-investment-tools.git
synced 2026-06-22 05:01:57 +03:00
2.1 KiB
2.1 KiB
Wealthfolio CSV Mapping
Load this when validating or debugging XTB to Wealthfolio exports.
Required Header
date,symbol,quantity,activityType,unitPrice,currency,fee,amount
XTB To Wealthfolio Mapping
Stock purchaseorOPEN BUY->BUYStock sale,CLOSE SELL, orOPEN SELL->SELLStock sellwithCLOSE BUY->SELLbecause XTB can encode sale close legs this wayDeposit->DEPOSITWithdrawal->WITHDRAWALDividend->DIVIDENDDividend tax->TAXFree funds interest->INTERESTCurrency conversion->FEE
Row Rules
BUYandSELL:symbol: real ticker when availablequantity: parsed share countunitPrice: parsed@ pricefee: inline trading fee if supported by the exporter, otherwise0.00amount: blank
- Cash activities (
DEPOSIT,WITHDRAWAL,INTEREST,TAX,FEE):symbol:$CASH-<CCY>quantity:1unitPrice:1amount: absolute cash value
DIVIDEND:- Keep the real security ticker when available
- Use
quantity = 1,unitPrice = 1, andamountas the absolute dividend cash value
Quantity Parsing
- For comments like
OPEN BUY 6 @ 301.50, quantity is6. - For split fills like
OPEN BUY 1/100 @ 14.3130, quantity is the numerator1, not0.01. - If no parseable quantity exists, the exporter may fall back to
abs(amount) / price.
Validation Commands
- Install dependencies:
<skill-folder>/scripts/setup-env.sh - Validate bundled tools:
<skill-folder>/scripts/validate-export.sh - Generate default CSV:
<skill-folder>/scripts/export-wealthfolio.sh <report.xlsx> - If working inside the original project repository, full tests are also useful:
.venv/bin/python -m pytest -q
Import Readiness Checks
- Header exactly matches the required schema.
- Activity types are among Wealthfolio-supported values used by the exporter.
- Trade rows have blank
amount. - Cash rows have nonblank positive
amountand$CASH-<CCY>unless dividend ticker retention applies. CLOSE BUYstock-sale rows export asSELL.- Split-fill rows use numerator quantity.