IG positions and P&L to CSV
Reads your open positions and realised P&L from IG and writes a CSV you can open in any spreadsheet.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
Works with IG. Independent and unofficial: not a product of, and not endorsed by, IG.
Test pending. No end to end run on a demo account has been recorded for this app, so it carries no tested mark.
What it does
- Logs in with POST /session on the IG demo host.
- Reads open positions with GET /positions.
- Reads realised P&L with GET /history/transactions and writes both to CSV.
Endpoints it uses
- GET/positionsAll open positions on the active account, each with its market snapshot.
- GET/history/transactionsCash transactions (realised profit and loss, funding, deposits). This is the one you want for a trade journal or tax spreadsheet.
- POST/sessionLog in with username and password. Returns CST and X-SECURITY-TOKEN in the response headers; send both on every later call.
Source code
No public source link yet.