preview_limit_order
Preview a limit order's cost before placing it. Get commission estimates and pre-trade disclosure from Darwin to avoid unexpected expenses.
Instructions
Ask Darwin what an order would cost, without placing it. Use this before place_limit_order, and whenever the user asks about commissions.
The order is submitted and deliberately left unconfirmed, so it never reaches the market, and Darwin answers with its pre-trade disclosure: the instrument's full name, the amount, the commission that would apply, and any conflict-of-interest note. This is the only way to obtain commission figures — no dAPI command reports them, and they depend on the order's value, so they cannot be looked up in advance.
Read on_market in the response before describing the outcome. It should be
false. If it is true, Darwin was not configured to ask for confirmation and
the order IS live — say so immediately and prominently.
Subject to the same DIRECTA_ENABLE_ORDERS gate as place_limit_order, since this does send an order command to a real account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| price | Yes | ||
| symbol | Yes | ||
| order_id | No | ||
| quantity | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||