Debugging FMZ JavaScript Backtests with Chrome DevTools
Summary
This guide explains how to inspect JavaScript strategy execution during an FMZ backtest using Chrome DevTools. Adding a debugger statement pauses execution at a chosen point when DevTools is open. From there, traders can inspect variable values, set additional breakpoints, resume execution, and step through function calls to locate errors.
A sample strategy illustrates how this process exposes a case-sensitive ticker field mistake: an undefined price reaches an order function and causes a type error. The example shows how to follow execution to the failing call and examine its inputs. The method can also help find issues such as invalid array indexing or undefined variables. It applies specifically to JavaScript strategies on FMZ; the article does not assess trading performance or explain how to debug other languages or platforms.
Key ideas
- Chrome DevTools can pause an FMZ JavaScript backtest at a debugger statement.
- Inspect variables and step through execution to locate where an error occurs.
- Additional breakpoints can be set by clicking line numbers in the debugger.
- A case-sensitive ticker field mistake can pass an undefined value to an order call.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.