trading_agent.scheduling.built_in_jobs
¶
The two jobs every desk gets from trading_agent.toml rather than from its jobs file.
- The heartbeat wakes the desk every few minutes while NSE equities trade, to look at its positions, orders and plans. It is off unless the desk's heartbeat_minutes is set, because every heartbeat is a model turn. A heartbeat the desk answers with NOTHING_TO_DO produces no message.
- The rollover runs /rollover after the close on trading days, 15:45 by default, so the day's summary and the skill review happen right after the market shuts instead of with the next morning's first message.
- Each scheduled check wakes the desk at a set time on trading days, such as 09:05, to follow its Persona.md's routine for that time; the desk may answer NOTHING_TO_DO.
Typical usage example:
jobs = BuiltInJobs().jobs(heartbeat_minutes=15, rollover_time='15:45')
HEARTBEAT_TEXT
module-attribute
¶
HEARTBEAT_TEXT = '[Heartbeat] Look at your open positions, orders, price alerts and plans for the rest of the session, and act if something needs doing. If nothing does, reply with exactly NOTHING_TO_DO and nothing else.'
CHECK_TEXT
module-attribute
¶
CHECK_TEXT = '[Scheduled check at {time}] Do what your Persona.md says for this time of day. If nothing needs doing, reply with exactly NOTHING_TO_DO and nothing else.'
BuiltInJobs
¶
Makes a desk's built-in jobs.
jobs
¶
The built-in jobs for a desk's settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heartbeat_minutes
|
int | None
|
Minutes between heartbeats during market hours, or None for no heartbeat. |
required |
rollover_time
|
str
|
"HH:MM" India time on trading days when the session rolls over. |
required |
scheduled_checks
|
list[str] | None
|
"HH:MM" India times on trading days for the desk's routine checks. |
None
|
Returns:
| Type | Description |
|---|---|
list[CronJob]
|
The rollover job, each scheduled check, and the heartbeat when it is on. |