How to backtest an ML-driven strategyBacktesting pitfalls and how to avoid themGetting the data rightLook-ahead bias – use only point-in-time dataSurvivorship bias – track your historical universeOutlier control – do not exclude realistic extremesSample period – try to represent relevant future scenariosGetting the simulation rightMark-to-market performance – track risks over timeTransaction costs – assume a realistic trading environmentTiming of decisions – properly sequence signals and tradesGetting the statistics rightThe minimum backtest length and the deflated SROptimal stopping for backtestsHow a backtesting engine worksVectorized versus event-driven backtestingKey implementation aspectsData ingestion – format, frequency, and timingFactor engineering – built-in factors versus librariesML models, predictions, and signalsTrading rules and executionPerformance evaluationbacktrader – a flexible tool for local backtestsKey concepts of backtrader's Cerebro architectureData feeds, lines, and indicatorsFrom data and signals to trades – strategyCommissions instead of commission schemesMaking it all happen – CerebroHow to use backtrader in practiceHow to load price and other dataHow to formulate the trading logicHow to configure the Cerebro instancebacktrader summary and next stepsZipline – scalable backtesting by QuantopianCalendars and the Pipeline for robust simulationsBundles – point-in-time data with on-the-fly adjustmentsThe Algorithm API – backtests on a scheduleKnown issuesIngesting your own bundles with minute dataGetting your data ready to be bundledWriting your custom bundle ingest functionRegistering your bundleCreating and registering a custom TradingCalendarThe Pipeline API – backtesting an ML signalEnabling the DataFrameLoader for our PipelineCreating a pipeline with a custom ML factorHow to train a model during the backtestPreparing the features – how to define pipeline factorsHow to design a custom ML factorTracking model performance during a backtestInstead of how to useSummary