Skip to content
All library documents

Extending Blockly Trading Templates with Custom JavaScript Modules

Article FMZ forum · Author: Ninabadass

Summary

This tutorial explains how a JavaScript template on the FMZ platform can add custom modules to a visual Blockly strategy editor. It describes the module definition fields, including the block type, displayed label, input arguments, generated code, output type, and color. The examples define a simple value-returning block and a custom moving-average block that retrieves price records and computes an MA when enough data is available.

The tutorial then describes enabling the template in a strategy, finding the added blocks in the editor, and checking the generated JavaScript. It reports a successful example calculation, illustrated through screenshots, but supplies no benchmark or trading-performance evidence. The MA example depends on the platform’s record and indicator APIs, and its handling of insufficient history and return values should be checked in the target strategy environment. The method is about extending a visual programming interface, not a standalone trading signal.

Key ideas

  • A JavaScript template can define additional blocks for the FMZ visual strategy editor.
  • Block definitions specify labels, inputs, generated code, and output types.
  • The example MA block obtains market records and calculates an average when sufficient records exist.
  • Enabling the template makes the new modules available in a strategy’s visual editor.
  • The tutorial demonstrates functionality but provides no evidence of trading performance.

Tags

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