trading_agent.terminal.screens.trading_screen
¶
The Trading page: each desk's profit and stocks, halts, positions, the desks' open orders, UBI's order book, and the kill switch.
It copies the web page's TradingPage.tsx. The kill switch halts every desk and flattens the account; like the web page, it asks for a reason and the typed word FLATTEN.
Typical usage example:
app.push_screen(TradingScreen('general'))
TradingScreen
¶
Bases: PageScreen
The Trading 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/trading_screen.py
compose_page
¶
Builds the page's sections.
Yields:
| Type | Description |
|---|---|
Widget
|
The sections, in a scroll area. |
Source code in src/trading_agent/terminal/screens/trading_screen.py
on_mount
¶
Sets up the tables' columns, then reads the data.
Source code in src/trading_agent/terminal/screens/trading_screen.py
refresh_page
async
¶
Reads the account and the desks' open orders.
Source code in src/trading_agent/terminal/screens/trading_screen.py
action_load_order_book
¶
action_next_book_kind
¶
Switches between orders, trades and open parent orders, and loads them.
Source code in src/trading_agent/terminal/screens/trading_screen.py
action_kill_switch
¶
Asks for a reason and FLATTEN, then fires the kill switch.