trading_agent.tools.set_price_alert_tool
¶
The set_price_alert tool: asks the market watcher to wake the desk when a price is reached.
Typical usage example:
tool = SetPriceAlertTool(reader, store)
SetPriceAlertArguments
¶
Bases: InstrumentArguments
The arguments of set_price_alert.
Attributes:
| Name | Type | Description |
|---|---|---|
condition |
Literal['above', 'below']
|
"above" to fire when the price rises to or past it, "below" when it falls to or past it. |
price |
float
|
The price, in rupees. |
note |
str
|
What you want to do when it fires, so your future self knows. |
SetPriceAlertTool
¶
Bases: Tool
Adds a price alert.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reader
|
BrokerReader
|
The shared UBI reader. |
required |
store
|
PriceAlertStore
|
The desk's alerts. |
required |
Source code in src/trading_agent/tools/set_price_alert_tool.py
run
async
¶
Checks the instrument and the current price, then stores the alert.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
SetPriceAlertArguments
|
The instrument, side, price and note. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The alert and every active alert, or why it was refused. |