Historical Data, CTA Backtesting, and Parameter Optimization
Summary
The document describes a graphical workflow for downloading historical bars, configuring a CTA strategy backtest, reviewing performance statistics, and inspecting trades on a candlestick chart. Data can come from a domestic market data service, an international broker connection, or a crypto exchange. It notes practical constraints, including the need to initialize a data client, connect to the broker before querying its history, and use a live exchange account for realistic crypto history where simulation data may differ.
For optimization, it presents grid search over parameter ranges and a genetic algorithm that evolves candidate settings through selection, crossover, and mutation. Grid search can distribute backtests across CPU processes, while caching can avoid repeated evaluations during later genetic iterations. Results are ranked by a chosen metric or reported as a Pareto set. The document explains the tooling and workflow but supplies no strategy-specific performance results or safeguards against overfitting.
Key ideas
- Historical data must be available locally or retrieved through a connected provider before running a backtest.
- Backtests require strategy settings and trading assumptions such as fees, slippage, contract size, tick size, and capital.
- Performance review includes summary statistics, equity and drawdown charts, daily profit and loss, and trade markers.
- Grid search evaluates parameter combinations and can run them in parallel across CPU processes.
- A genetic algorithm searches parameter settings through population evaluation, selection, crossover, and mutation.
Tags
From a private course collection; the original is not published.