Posts

Showing posts from August, 2026

Building the Backtester Part 2 — A Strategy Engine That Matches TradingView Semantics

Image
📘 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 ...

Building the Backtester Part 1 — A Historical Data Pipeline with yfinance and ccxt

Image
📘 Educational — not financial advice. This post walks through the data layer 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 later in this series — describe past behaviour on historical data and do not guarantee future performance. See full Disclaimer . "Every honest backtest disagreement I have ever had with someone — mine included — turned out, on inspection, to be a disagreement about the data. Different symbols, different sessions, different adjustments, different timezones. The strategy code was almost never the problem." In post 2 I laid out the four-layer architecture of the Python backtester: data, engine, metrics, viz. This post fills the first layer. By the end of it there is a small, three-file data/ package that pulls OHLCV from yfinance and ccxt , normalises it to UTC, caches it to Parquet, and r...

Why Free TradingView Isn't Enough — Designing a Python Backtester That Feels Like TradingView

Image
📘 Educational — not financial advice. This post describes the architecture 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 later in this series — describe past behaviour on historical data and do not guarantee future performance. See full Disclaimer . "A backtest report you cannot reproduce with code you can read is a very expensive way to feel confident about a trading idea. The point of building a small Python harness is not that Python is faster than Pine — it is that when the report looks wrong, you can go read the eighty lines that produced it." In post 1 I walked through Pine Script v5 as a language and mentioned in passing that the free TradingView tier eventually stops being enough for real backtesting. This post is the long form of that observation. It maps the four specific walls the free tier puts in...

Pine Script v5 Fundamentals for Systematic Traders

Image
📘 Educational — not financial advice. This post explains Pine Script v5 mechanics and shows working examples. It is not investment advice, a trade signal, or a claim that any specific script or strategy will be profitable. Backtested results — including any shown in this series — do not guarantee future performance. See full Disclaimer . "Pine Script looked, from a distance, like a shorthand for TradingView charts. When I actually opened the editor, it turned out to be a small language with sharp edges — the kind of edges an engineer notices first and a discretionary trader stumbles into last." I opened the Pine Editor on TradingView for the first time in 2018, mostly out of curiosity. I wanted to see if I could translate a checklist I was already running by eye into something a computer could plot for me. Two hours later I had a script that painted crossovers on a chart, and a strong feeling that I had missed several things about how the runtime worked. This po...