Building the Backtester Part 2 — A Strategy Engine That Matches TradingView Semantics
📘 Educational — not financial advice. This post walks through the strategy engine of an open-source backtesting harness for personal use. It is not investment advice, a trade signal, or a claim that any specific strategy will be profitable. Backtested results — including any produced in this post — describe past behaviour on historical data and do not guarantee future performance. See full Disclaimer . "An engine that fills at the close of the bar the signal fires on is not a backtester. It is a machine for producing equity curves that would have been great if you had a time machine. Every honest engine spends most of its complexity refusing to do exactly that." In post 3 the data layer landed — three files, UTC-indexed OHLCV, Parquet-cached. This post fills the second of the four architectural layers: the strategy engine. By the end of it there is a working engine/ package plus one end-to-end example — examples/01_sma_cross.py — that produces a trade list and ...