v1

latestOpenAPI 3.0.12026-07-26171200932.8 KB
Deprecated

Create a market order to open a position by specifying the amount of cash you would like to use in the trade.

Deprecated: This endpoint is no longer present in the current eToro Public API Swagger. Prefer the current replacement endpoints where available.

This endpoint allows traders to place a market order to open a position by specifying the investment amount instead of specifying the number of units. The trade will be executed at the market price, and leverage, stop-loss, and take-profit settings can be applied.

post/api/v1/trading/execution/demo/market-open-orders/by-amount

Headers

x-request-idstring uuid required
Example:eff9aecd-c392-45be-b379-dfc16a2da2e7

A unique request identifier.

x-api-keystring password required
Example:lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663

API key for authentication.

x-user-keystring password required
Example:eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_

User-specific authentication key.

Request body

InstrumentIDinteger required

The unique identifier of the financial instrument to trade.

IsBuyboolean required

True for a long position, false for a short position.

Leverageinteger required

The leverage multiplier for the trade.

Amountnumber double required

The amount of money to invest in the trade.

StopLossRatenumber double nullable

The stop-loss trigger price at which the position will generate a Market Order to close (after it was opened). StopLoss trigger price must be worse than current price.

TakeProfitRatenumber double nullable

The take-profit trigger price at which the position will generate a Market Order to close (after it has opened). TakeProfit trigger price must be better than the current price.

IsTslEnabledboolean nullable

Indicates if a trailing stop loss (TSL) is enabled. This means that the stoploss rate indicated will get updated automatically whenever the asset price increases (for long positions) or decreases (for short position) effectively keeping the stoploss in a constant gap from the best price achieved so far.

IsNoStopLossboolean nullable

True if no stop-loss is set for this order.

IsNoTakeProfitboolean nullable

True if no take-profit is set for this order.

Response

Successfully opened a market order.

tokenstring uuid

A unique confirmation token for the order.