FMZ Pine Tutorial: Execution Models and a SuperTrend Trailing Exit
Summary
This tutorial explains how FMZ adapts Pine scripts for strategy writing, charting, backtesting, and live trading. It outlines platform-specific differences, including where execution settings and precision are configured, contract-code requirements, added debugging functions, chart overlay options, and the treatment of commissions in average price. It also introduces sequential bar processing and distinguishes close-of-bar execution, where signals act on the next bar, from real-time execution, where logic can run as prices change.
A later example combines SuperTrend direction changes with long and short entries, closes positions on reversal signals, and adds a trailing exit using a trigger price and offset. The tutorial describes the example’s state tracking and chart display, but the excerpt supplies no evidence of profitability. Results would depend on execution mode, market data, fees, instrument settings, and backtest assumptions; the example should be treated as an implementation illustration rather than a validated strategy.
Key ideas
- FMZ Pine scripts use platform settings for execution behavior, precision, and futures contract selection.
- Close-of-bar mode evaluates completed bars, while real-time mode can evaluate price changes within a bar.
- The example enters positions based on SuperTrend direction and closes them after reversal signals.
- A trailing exit is added with a trigger price and offset, with state variables tracking order status.
- The tutorial provides implementation guidance but no performance validation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.