Building a Grid Trading Backtest with FMZ
Summary
The document describes an online workflow for backtesting a grid trading strategy through FMZ. Users set the simulation dates, currency, balances, and grid parameters, including price bounds, grid spacing, and order size. The workflow creates the backtest context, runs the strategy, retrieves the resulting net asset data, and calculates summary figures such as estimated benefit, trade count, and fees. The example calculation derives benefit from matched buy and sell counts and the grid spacing, then annualizes it using the selected date range.
The trading loop initializes grid levels around the current price, places orders, and periodically checks for fills so it can place replacement orders. The author reports that simulations lasting up to 14 days were fast enough for a user-facing tool, while longer runs could be slow. The post offers no detailed performance results or validation of its benefit formula, which assumes a simplified relationship between matched trades and profit. Treat the speed claim and calculation as implementation notes rather than evidence that the strategy is profitable.
Key ideas
- Users can configure the simulation period and grid parameters before launching a backtest.
- The workflow runs an FMZ simulation and uses its returned net asset data to calculate summary metrics.
- The grid strategy initializes price levels, places orders, and checks periodically for fills before reordering.
- The example benefit calculation uses matched buy and sell counts, grid spacing, and an order amount.
- The author reports that simulations up to 14 days were responsive enough for a front-end workflow, but longer tests could be slow.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.