trading_agent.tools.modify_order_tool
¶
The modify_order tool: changes the quantity, price or trigger price of one of the desk's own open orders.
A desk can change only an order it placed, as the desk order book records. Making an order bigger adds risk, so the extra quantity goes through the risk engine as if it were a new order; a smaller order or a new price does not. A dry-run order reached no broker, so changing it is only recorded.
Typical usage example:
tool = ModifyOrderTool(services, 'main', 'dry_run')
ModifyOrderArguments
¶
Bases: BaseModel
Which order to change, and how.
Attributes:
| Name | Type | Description |
|---|---|---|
parent_id |
str | None
|
The parent_id that place_order or place_bracket_order answered with, for an order UBI is still holding or for one part of a bracket; or None. |
order_id |
str | None
|
The broker's order_id, for an order already at a broker; or None. |
part |
str | None
|
With parent_id, the path of one part of a bracket that has not been sent yet, such as root.each_fill.children.0 for its stop, as get_orders open_parents lists it; or None. |
quantity |
int | None
|
The new total quantity in units, counting what has filled, or None to keep it. |
price |
float | None
|
The new limit price in rupees, or None to keep it. |
trigger_price |
float | None
|
The new trigger price in rupees, or None to keep it. |
reason |
str
|
Why the desk is changing the order, kept in the journal. |
ModifyOrderTool
¶
Bases: OrderTool
Changes one of the desk's own orders.