Open Trade
MngOpenTrade¶
Description: Opens a new market trade on behalf of the manager. The manager specifies trade parameters such as login, symbol, command type, volume, SL/TP, and optional metadata.
This method follows the common Trade Request Lifecycle. A successful response is an acknowledgment of accepted processing, not a guarantee that the trade has already reached its final runtime state.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| login | int | Yes | User login ID |
| cmd | int | Yes | Market trade command only (OP_BUY=0 or OP_SELL=1) |
| volume | int | Yes | Trade volume in minimal lots |
| symbol | string | Yes | Trading instrument |
| sl | double | Yes | Stop Loss value |
| tp | double | Yes | Take Profit value |
| open_price | double | No | Optional price to open the trade at |
| open_time | int64 | No | Optional trade open timestamp |
| comment | string | No | Optional comment for the trade |
| __access | object | Yes | Access object with type field |
Request Parameters Example¶
{
"login": 123456,
"cmd": 0,
"volume": 1000,
"symbol": "EURUSD",
"sl": 1.1000,
"tp": 1.2000,
"open_price": 1.1050,
"open_time": 1629981234,
"comment": "manager execution",
"__access": {
"type": 1
}
}
Response Semantics¶
If the request is accepted:
- the trade payload passed validation
- manager-side checks passed
- an
orderidentifier was reserved - the open-trade request was accepted into runtime processing
The response should be treated as an acknowledgment object. In the raw TCP response envelope,
the fields below are returned inside data.
Response Parameters¶
| Name | Type | Description |
|---|---|---|
| accepted | bool | Always true on successful acknowledgment |
| order | int | Reserved order identifier for tracking the trade lifecycle |
| login | int | Target account login |
| symbol | string | Requested symbol |
| cmd | int | Requested trade command |
| volume | int | Requested trade volume in minimal lots |
| state | int | Accepted request state, typically TS_OPEN_REQUEST |
Response Example¶
{
"extID": "open-1",
"status": 200,
"data": {
"accepted": true,
"order": 1001234,
"state": 1,
"login": 123456,
"symbol": "EURUSD",
"cmd": 0,
"volume": 1000
}
}
Lifecycle Notes¶
- The immediate response is not a final execution report.
- The trade should be tracked by
order. - Final state transitions are observed through trade events and trade queries.
MngOpenTradeis market-only.- For pending orders use MngOpenPendingTrade.
- Pending commands (
2..5) are rejected at request validation time.