Position Action
4 tools — auto-generated from the MCP server's tool schemas.
Generated
This page is generated from packages/server/mcp/src/tools/*.ts by pnpm docs:generate-tools. Do not edit it by hand — edit the tool's description/schema in source and regenerate.
close_all_positions
Closes all currently open positions, optionally filtered by symbol. The EA executes all closes in a single command to avoid N round-trips and partial-disconnect risk. Returns a results array with per-ticket success/failure. Defaults to dry_run=true — set dry_run=false to execute live. Requires the trade capability and inp_AllowTrading=true on the EA.
This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | No | — | — |
dry_run | boolean | No | true | — |
terminal_id | string | No | — | — |
reverse_position
Closes an open position and opens a market order in the opposite direction as ONE EA command (single trade-context acquisition — minimises the gap between the two fills vs separate close_position + place_order calls). volume defaults to the closed volume; optional stop_loss / take_profit apply to the new position. If the close succeeds but the open fails (margin, market closed), returns REVERSE_PARTIAL with the close details and leaves the account flat — the EA never retries the open on its own. Defaults to dry_run=true — set dry_run=false to execute live. Requires the trade capability and inp_AllowTrading=true on the EA.
This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ticket | integer | Yes | — | — |
volume | number | No | — | — |
stop_loss | number | No | — | — |
take_profit | number | No | — | — |
dry_run | boolean | No | true | — |
terminal_id | string | No | — | — |
set_breakeven
Moves the stop loss of a position (or all positions) to its entry price. Optional buffer_points adds N points on the safe side of entry. Returns POSITION_NOT_IN_PROFIT if the position has not yet moved favourably. Defaults to dry_run=true — set dry_run=false to execute live. Requires the trade capability and inp_AllowTrading=true on the EA.
This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ticket | integer | No | — | — |
buffer_points | integer | No | 0 | — |
dry_run | boolean | No | true | — |
terminal_id | string | No | — | — |
set_trailing_stop
Registers a software trailing stop on a position. The EA updates the SL each timer cycle when price moves trailing_points in the position's favour. IMPORTANT: trailing state is lost if the EA restarts — callers should re-set after reconnect. trailing_points minimum is 10. Defaults to dry_run=true — set dry_run=false to register live. Requires the trade capability and inp_AllowTrading=true on the EA.
This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ticket | integer | Yes | — | — |
trailing_points | integer | Yes | — | — |
dry_run | boolean | No | true | — |
terminal_id | string | No | — | — |