trading_agent.tools.cron_create_tool
¶
The cron_create tool: schedules a repeating job for the desk.
Typical usage example:
tool = CronCreateTool(store, calendar, hours)
CronCreateArguments
¶
Bases: BaseModel
The arguments of cron_create.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
A short name for the job. |
schedule |
str
|
Five cron fields in India time: minute hour day month weekday, such as "30 9 * * 1-5". |
instructions |
str | None
|
For an agent job: the message you will receive at each run, or the subagent's task. |
command |
str | None
|
For a command job instead: the exact shell command to run, such as "python3 scan.py". |
target |
str
|
"desk" for yourself, or "subagent: |
trading_days_only |
bool
|
Whether to skip weekends and exchange holidays. |
market_hours_only |
bool
|
Whether to run only while NSE equities trade. |
deliver_url |
str | None
|
An address to POST the result to, or None. |
CronCreateTool
¶
Bases: Tool
Adds a repeating job.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store
|
CronJobStore
|
The desk's jobs. |
required |
calendar
|
MarketCalendar
|
Decides trading days. |
required |
hours
|
ExchangeHours
|
Decides market hours. |
required |
Source code in src/trading_agent/tools/cron_create_tool.py
run
async
¶
Checks and stores the job, and shows its next runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
CronCreateArguments
|
The job. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The job's id and next three runs, or why it was refused. |