Skip to content
All library documents

Debugging JavaScript Strategy Backtests with Chrome DevTools

Article FMZ digest · Author: 发明者量化-小小梦

Summary

This tutorial shows how to debug JavaScript strategies during FMZ backtests using Chrome DevTools. It explains that a debugger statement in the strategy can pause execution when DevTools is open, allowing the developer to inspect variables and resume execution from a chosen point. The guide also describes setting breakpoints by clicking source lines and using controls to step through code or function calls.

A sample strategy illustrates how this process can expose a case-sensitive property-name error: the ticker object contains a capitalized field, while the code requests a lowercase one, passing an undefined value into an order function and causing an exception. The walkthrough shows how inspecting the value at the call site helps locate the problem. The method is specifically described for JavaScript strategies on FMZ, and the breakpoint instruction is ignored if DevTools is not open before the backtest. The article teaches debugging workflow rather than trading logic or strategy performance.

Key ideas

  • Chrome DevTools can pause an FMZ JavaScript backtest at an inserted debugger statement.
  • Variable inspection and step controls help trace execution and identify the source of a failure.
  • A sample error arises from using the wrong capitalization for a ticker property.
  • The described method applies to JavaScript strategies on FMZ and requires DevTools to be open before the backtest.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.