Total invested only refers to your USD balance.
The Calculation Process
Calculating total invested involves fetching your account data and summing all amounts allocated to positions and orders.1. Endpoints
Use the P&L endpoint to retrieve your account information. Demo Account:GET https://public-api.etoro.com/api/v1/trading/info/demo/pnl
Real Account: GET https://public-api.etoro.com/api/v1/trading/info/real/pnl
2. Header Requirements
Remember to include your authentication headers with every request.x-api-keyx-user-keyx-request-id
3. Calculation Formula
positionsis an array of your open positionsmirrorsis an array of your copy trading portfoliosmirrors[i].positionsis an array of positions within each mirror portfoliomirrors[i].availableAmountis the available amount in each mirror portfoliomirrors[i].closedPositionsNetProfitis the net profit from closed positions in each mirror portfolioordersForOpenis an array of pending market orders (filtered to only include manual positions wheremirrorID = 0)ordersis an array of pending Market-if-touched orderstotalExternalCostsis the total external costs for each orderamountis the allocated amount for each position or order
Examples
Example Calculation
If your account has:positions: Two positions withamountvalues of 500 and 300mirrors: One mirror portfolio with:- Two positions with
amountvalues of 200 and 150 availableAmount: 100closedPositionsNetProfit: 50
- Two positions with
ordersForOpen: One manual pending order withamountof 200 andtotalExternalCostsof 10 (wheremirrorID = 0)orders: One existing order withamountvalue of 150
Best Practices
- Monitor Your Investment: Regularly check your total invested to understand your capital allocation across all positions and orders.
- Account for Mirror Portfolios: Remember that mirror portfolios contribute to your total invested through both their positions and adjusted available amounts.
- Include External Costs: Don’t forget to include external costs from manual pending orders in your calculation.
- Use the Correct Environment: Make sure to use the demo endpoint when testing and the real endpoint for live trading.