Building a Moving-Average Trading Strategy with Visual Programming
Summary
This tutorial introduces FMZ Quant's Blockly visual programming environment through a simple moving-average strategy. It opens a long position when flat and the close is above a 50-period average, opens short when flat and below it, and closes each position when price crosses back over the average. The walkthrough explains how to assemble the logic from market data, position state, and comparison blocks.
It also teaches how K-line records are stored in arrays, how to access the latest and previous records, and how to retrieve fields such as close, time, and volume. The article presents drag-and-drop blocks as an accessible way to express programming logic and demonstrates a basic output example. It does not provide backtest results, transaction-cost assumptions, or risk controls; it also notes that the platform's available API is limited, so the visual tool is best treated as a learning aid and strategy-logic organizer.
Key ideas
- The example strategy trades around a 50-period moving average, entering when flat and closing on a return across the average.
- The tutorial explains how to read current and prior K-line records from an array.
- Visual blocks represent common programming elements such as variables, functions, arrays, and trading actions.
- The article presents visual programming as an entry point for beginners and a way to organize strategy logic.
- No performance results or risk-management rules are provided, and platform API coverage is described as limited.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.