Event-Driven Double EMA Trading with Scheduled Account Checks
Summary
This example shows how to run a double exponential moving average strategy through an event-driven trading system. It creates an event engine, subscribes to tick updates, and sends those updates to a strategy callback. A websocket supplies live market data, while scheduled tasks periodically retrieve hourly bars, open orders, and position information. The script also checks the strategy’s position on a repeating loop.
The document is an implementation outline rather than a full explanation of the EMA signal or its parameters. It gives no backtest, performance evidence, risk controls, or discussion of order sizing and failure handling. Its value is mainly in illustrating how market data, strategy callbacks, scheduled account checks, and a persistent runtime can be connected; it does not establish that the strategy is profitable or suitable for live trading.
Key ideas
- An event engine can dispatch incoming tick data to a strategy callback.
- A websocket subscription supplies live market updates for the selected instrument.
- Scheduled tasks can refresh bar data, open orders, and position information at different intervals.
- The example runs a separate recurring position check alongside its scheduled jobs.
- The code does not provide performance evidence or describe risk controls.
Tags
From a private course collection; the original is not published.