Docs / Concepts / Components
RealStrategies
The strategy API.
Handlers
- on_start, on_stop
- on_quote, on_trade, on_bar
- on_timer
- on_order_event
Commands
- submit_market, submit_limit
- submit_stop_market, submit_stop_limit
- submit_bracket
- cancel
- set_timer, cancel_timer
- subscribe_bars
Contract
A strategy never talks to a venue. It asks its context to act, and the engine carries the command out after the handler returns, through the risk checks. The context gives read-only access to the cache, portfolio and orders.
Timers
Timers are named per strategy; setting the same name again replaces the timer. A strategy cannot cancel another strategy's timer.