Diagnosing Divergent Dual Moving Average Backtests
Summary
This forum post compares backtest results for a 20-day and 110-day moving-average strategy on Vanke A shares across two platforms. The strategy buys when the shorter average exceeds the longer one and exits when it falls below, using full portfolio allocation. The user reports different cumulative returns despite describing the input prices as adjusted for corporate actions, and asks which result is correct. The sample code specifies daily history, a warm-up period, stock order sizing, buy and sell price fields, and a backtest interval.
The post does not resolve the discrepancy or establish that either platform is correct. It does, however, surface factors that require alignment when comparing backtests, including the exact data series and adjustment convention, dates, signal timing, execution prices, transaction costs, and treatment of corporate actions. The code also shows differing date settings between data loading and the backtest call, while no trade log or reconciliation is supplied. The reported return figures are therefore platform-specific claims, not independently verified evidence of strategy performance.
Key ideas
- The example uses a 20-day and 110-day moving-average crossover to enter and exit a single-stock position.
- The author reports substantially different backtest returns across platforms while claiming comparable adjusted prices.
- A valid comparison requires matching price adjustments, date ranges, signal timing, execution prices, and cost assumptions.
- The displayed code includes different ranges for data loading and the backtest, and the post does not reconcile results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.