trading_agent.tools.flatten_desk_tool
¶
The flatten_desk tool: cancels every open order of the desk and closes every position the desk owns.
It touches only what the desk itself placed or owns, never another desk's trades or the user's own holdings; flattening the whole account is left to the kill switch and to the user. Each closing order passes the risk engine, which always lets a desk reduce its own position but still checks that the exchange is open.
Typical usage example:
tool = FlattenDeskTool(services, 'main', 'dry_run')
FlattenDeskArguments
¶
Bases: BaseModel
Why the desk is flattening.
Attributes:
| Name | Type | Description |
|---|---|---|
reason |
str
|
Why, kept in the journal. |
FlattenDeskTool
¶
Bases: OrderTool
Cancels the desk's orders and closes the desk's positions.