Strategy Code and API Examples: What Code Quality Reveals About Process
Algorithmic trading strategy code is not production trading infrastructure. The gap between the two is one of the most consistent misunderstandings in how managers present their technical work to investors, and one of the most consequential.
Sample code, research notebooks, and backtesting scripts show signal logic. They rarely show the error handling, state management, execution integration, and operational controls that determine whether that signal logic can be traded at scale. A beautifully written backtesting script can coexist with a fragile production system, and the script itself will not tell you which one you are looking at.
That distinction is not a criticism of any specific tool. Backtrader, Zipline, QuantConnect’s LEAN engine, and similar research platforms are designed for signal development. They do very well at what they are designed for. They also carry documented limitations in fill modeling, delisting handling, and live-state management that matter considerably when interpreting results they produce.
This page covers what code quality signals about a manager’s process, where research code diverges from production systems, and what to ask before treating a code demonstration as operational evidence.
What strategy code can and cannot tell you
Well-written strategy code demonstrates signal design and model structure. It shows how the manager translates a hypothesis into rules, how positions are sized relative to signal strength, how entry and exit conditions are defined. For understanding the manager’s thinking, code is a useful artifact.
What it does not demonstrate is production quality. Production quality is determined by how the system handles bad data, missed callbacks, partial fills, connection failures, and the many failure modes that a backtesting framework either simplifies or ignores entirely. None of those appear in a research notebook. They appear in an incident log from a system that has been live long enough to encounter them.
Known gaps in common backtesting frameworks
Every serious backtesting framework carries documented limitations that affect how research results should be interpreted. These are not obscure issues. They appear in the platforms’ own documentation and issue trackers.
Fill modeling. Backtrader’s Cerebro and LEAN’s default execution models fill orders at bar prices, which assumes the strategy can trade at the period’s open, close, or VWAP without moving the market. For small, liquid strategies this assumption is approximately correct. For anything with meaningful size relative to daily volume, it is materially optimistic. Backtests that do not model market impact explicitly are producing gross-of-impact numbers and presenting them as if they were net.
Delisting and survivorship handling. LEAN’s documented behavior on delisted securities can produce final-day fills at prices that do not reflect real liquidation costs. Zipline carried a known issue with how it handled alpha and beta computation near corporate events. These are not obscure bugs. They are documented limitations that affect every backtest run on those platforms without explicit corrections. The practitioner literature is consistent on this: without real delisting histories applied to the backtest, the survivorship adjustment is weak regardless of how it is described.
Event timing. Research frameworks typically process events at bar boundaries, which is cleaner than the real-time asynchronous environment production systems operate in. Backtrader’s documentation notes that live trading introduces data latency and event ordering that does not exist in backtesting mode. A strategy that looks timing-insensitive in research may not be in production.
- The fill model and its assumptions: at what price are fills recorded, and what market impact model, if any, is applied?
- The delisting and corporate action handling: does the backtest include securities that were subsequently removed from the index or exchange?
- The event timing assumptions: does the code process events synchronously at bar boundaries, or does it model asynchronous real-time execution?
- The gap between research code and production code: are they the same codebase, or is the research code a separate artifact from the system that trades?
What code quality signals about a manager’s process
Code quality is not just about signal elegance. It is about whether the development process would catch the errors that cause live underperformance. The signals worth looking for are not stylistic. They are structural.
A manager whose research code and production code are the same codebase has a continuous evidence chain from research to live. A manager whose research code is separate from production has a translation step, and translation steps are where assumptions get quietly changed. Which set of assumptions is running live is not always obvious from the research code.
Version control and commit history are more informative than the code itself. How often does the strategy code change? What types of changes are most common? A commit history showing frequent parameter adjustments on a live strategy is a different signal from one showing steady structural improvements with stable parameters. Neither is automatically good or bad. Both are informative about how the manager treats the separation between research and production.
Exception handling and logging in the code reveal how the developer thinks about failure. Code with no error handling assumes the happy path. Code with specific exception handling and structured logging was written by someone who has thought about what breaks and built a record of it.

What strategy code quality reveals about a manager’s development process. Algotrader.ch, 2026.
What investors should ask before treating code as evidence
The core distinction to keep in mind: code that demonstrates a signal is not the same as code that demonstrates a tradable process. The first shows the hypothesis. The second shows whether the hypothesis can survive contact with execution, infrastructure, and live market conditions.
- Is this the research codebase or the production codebase? If they are different, what are the differences?
- What fill model does the backtest use, and how is market impact handled for larger orders?
- How are delistings and corporate actions handled in the backtest, and is real delisting history used?
- Can you show the commit history for parameter changes made while the strategy was live?
A manager who can answer all four questions specifically is showing a development process that has been thought through. A manager who cannot distinguish their research codebase from their production codebase has not yet been asked that question carefully enough, or is running a process where the distinction does not exist.