Trade Excursion
1 tool in this category.
Overview
Trade Excursion includes 1 tool for this workflow area.
Available tools: get_trade_excursions.
Use the parameter tables and examples below as the canonical request contract.
get_trade_excursions
Measures how each trade moved after entry, for post-trade review and for comparing setups. Per trade: entry and exit (time in UTC ISO, converted with the broker's current UTC offset, so a trade from before a daylight-saving change can read an hour off; price), legs (each exit of a partially closed position; the trade's exit price is their volume-weighted average), original_sl and r_basis (the entry-to-original-stop distance, in PRICE), mae and mfe (largest move against / in favour of the entry, each as {price, points, r}; price is a non-negative distance, points are the symbol's smallest price steps (null if the symbol's digits could not be read), r = price / r_basis), time_to_mae_min and time_to_mfe_min (minutes from entry, to the bar holding the extreme), hold_min, realized_r (exit vs entry in units of r_basis, null while open), profit (sum of exit-deal profit; commission and swap are not in the deal data), and setup / run_id from the linked journal entries (most recent wins).
Select trades with ONE of: ticket (a position id, or any order/deal ticket of it), tickets (up to 50), or a window from/to (ISO UTC, default the last 30 days) with an optional symbol. include_open=true adds positions still open, measured up to now. Trades come newest first (open ones first), at most 200.
The original stop is the stop-loss the opening ORDER was placed with (original_sl_source: order_history), or the R basis of an exit plan set on the ticket (exit_plan). A stop added to the position later is NOT an original stop and is never used: when none is known, r_basis, every r and realized_r are null and the price and points figures are still returned — nothing is guessed. EAs older than 1.404 do not report order stop-losses, so their trades have no R (see warnings).
MAE/MFE come from M1 bar highs and lows (bid prices; a sell's real extremes are on the ask, so they differ by about the spread) between entry and exit. If M1 bars cannot be read for the period, the finest timeframe that covers it is used and data_source.precision is "approximate"; if no bars can be read, mae/mfe are null.
group_by (symbol, setup or run_id) adds aggregates, largest group first: trades, trades_with_r, mean and median of mae.r and mfe.r over trades whose R is known, and win_rate (share of closed trades with profit > 0); trades with no value for the key form the group null. NOT_FOUND if a single ticket matches no position. Available at Free+ tier.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ticket | integer | No | — | — |
tickets | array | No | — | — |
from | string | No | — | ISO UTC start of the window (by exit time); default 30 days before to. |
to | string | No | — | ISO UTC end of the window; default now. |
symbol | string | No | — | Window mode only: restrict to this symbol. |
include_open | boolean | No | false | — |
group_by | string | No | — | (one of: symbol, setup, run_id) |
Example Request
{
"tool": "get_trade_excursions",
"arguments": {}
}