trading_agent.terminal.screens.desks_screen
¶
The Desks page: every desk's state, profit and models, with pause, resume, flatten and a way into its chat.
It copies the web page's DesksPage.tsx. Enter on a desk opens its chat. Flatten runs the desk's own flatten_desk tool through the gateway, so it goes through the risk engine and the journal, and it asks for a reason first.
Typical usage example:
app.push_screen(DesksScreen('general'))
DesksScreen
¶
Bases: PageScreen
The Desks page.
Creates the page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
desk_name
|
str
|
The desk the chat shows. |
required |
Source code in src/trading_agent/terminal/screens/desks_screen.py
compose_page
¶
Builds the summary line and the desks table.
Yields:
| Type | Description |
|---|---|
Widget
|
The summary and the table. |
Source code in src/trading_agent/terminal/screens/desks_screen.py
on_mount
¶
Sets up the table's columns, then reads the data.
refresh_page
async
¶
Reads the desks and the account.
Source code in src/trading_agent/terminal/screens/desks_screen.py
on_data_table_row_selected
¶
Opens the chat with the desk chosen with Enter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
RowSelected
|
The choice. |
required |
Source code in src/trading_agent/terminal/screens/desks_screen.py
action_pause_or_resume
¶
Pauses the highlighted desk, or resumes it when paused.
action_flatten
¶
Asks for a reason, then flattens the highlighted desk.