Quick start
Run a backtest with the built-in buy-and-hold strategy:Backtest configuration
Configure backtests with comprehensive settings:Basic settings
Execution settings
Configure realistic trading costs and slippage:- Slippage models
- Latency models
- Market impact
Control how execution price differs from quoted price:
Data settings
Configure data handling:Survivor bias
Survivor bias
When
survivor_bias_free is true, the backtest includes delisted companies and failed stocks. This provides more realistic results, as strategies tested only on surviving companies tend to show inflated performance.Corporate actions
Corporate actions
adjust_for_splits: Adjust historical prices for stock splitsadjust_for_dividends: Adjust prices for dividend distributions
Data gaps
Data gaps
When
fill_gaps is true, missing data points are interpolated. Set to false for more realistic backtests that handle missing data explicitly.Running backtests
Backtest results
TheBacktestResult contains comprehensive performance data:
Equity curve
Access the equity curve to plot portfolio value over time:Trade log
Analyze individual trades:Event-driven architecture
GlowBack uses an event-driven architecture for realistic simulation: Events are processed chronologically across all symbols, ensuring realistic timing and preventing look-ahead bias.Python API
Run backtests from Python using the simplified API:Best practices
Use realistic execution settings
Use realistic execution settings
Always include commissions, slippage, and latency to avoid overfitting. Unrealistic assumptions lead to strategies that fail in live trading.
Test on multiple time periods
Test on multiple time periods
Run backtests across different market regimes (bull markets, bear markets, high volatility periods) to ensure robustness.
Avoid overfitting
Avoid overfitting
Split your data into training and testing periods. Parameters optimized on training data should be validated on out-of-sample testing data.
Account for survivorship bias
Account for survivorship bias
Enable
survivor_bias_free to include delisted stocks. Testing only on survivors inflates performance metrics.Monitor trade frequency
Monitor trade frequency
Strategies with very high trade frequency may not be practical due to execution costs and market impact. Check the trade log for realism.
Next steps
Performance analytics
Deep dive into performance metrics
Strategy development
Build custom strategies