A Dual Moving Average Crossover Strategy in a Quantitative Workflow
Summary
This introductory example builds a daily A-share strategy around a five-day and twenty-day moving average. It selects one stock, retrieves recent closing prices, computes both averages, buys to a fully invested target when the shorter average is higher, and exits when the longer average is higher. The article explains the platform’s initialization and recurring bar-handling functions, historical data retrieval, and target-based order calls.
It then outlines a workflow for running a historical simulation and starting paper trading to monitor signals, positions, profit and loss, and account risk measures. The material is a coding and platform tutorial, not an evaluation of the strategy: it reports no backtest performance or transaction cost assumptions. Its conditions compare the averages’ levels rather than explicitly detecting a crossover event, and the example’s full-investment rule and single-stock focus limit what can be inferred about broader use.
Key ideas
- A basic quantitative strategy specifies both the asset and the conditions for trading it.
- The example compares short and long moving averages of one stock’s closing prices.
- Target-based orders express buying and exiting as desired portfolio exposure or share count.
- The tutorial describes historical simulation followed by paper trading and monitoring.
- It gives no evidence that the moving-average rules are profitable after costs or risk.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.