Skip to main content
Once you have resolved your target asset’s instrumentId, you can begin executing trades. The eToro API separates trading logic into two distinct phases: opening a new position and closing an existing one.

Opening a Position

Use the v2 order endpoint to open a market position. You can specify exactly one sizing field: amount, units, or contracts.

Method 1: By Amount (Cash)

This is the most common method for dollar-cost averaging or fixed-budget strategies. You specify the cash value (e.g., $1,000) and the API calculates the units based on the current market price. Endpoint: POST /api/v2/trading/execution/orders
Note: You can apply additional settings such as leverage, stop-loss, and take-profit during this request.

Method 2: By Units (Volume)

Use this method when you need to control the exact volume of the asset (e.g., buying exactly 1.5 Bitcoin or 10 shares of Apple). Endpoint: POST /api/v2/trading/execution/orders

Example Request (Open by Amount)

The following examples demonstrate the full flow: Search for ‘BTC’ to get its ID, then Buy $1,000 worth of it.

Closing a Position

To close a trade, you must reference the specific positionId of the open position. You cannot simply “sell” the instrument; you must close the specific line item in your portfolio. Endpoint: POST /api/v1/trading/execution/market-close-orders/positions/{positionId}

Full vs. Partial Close

You can choose to close the entire position or just a portion of it.
  • Full Close: Omit the UnitsToDeduct parameter or set it to null. This liquidates the entire position.
  • Partial Close: Provide a specific value for UnitsToDeduct. Only that portion of the position will be closed, leaving the remainder active.

Example Request (Close Position)

Important Considerations

  1. Instrument IDs: You must know the numeric instrumentId before placing an order. Use the Search endpoint to resolve tickers (e.g., AAPL) to IDs.
  2. Demo Environment: When testing, use POST /api/v2/trading/execution/demo/orders to avoid risking real capital.
  3. Market Rates: It is recommended to check current rates using GET /api/v1/market-data/instruments/rates before executing orders to ensure price accuracy.