Structuring Polling and Bar-Driven Strategies in FMZ
Summary
The guide outlines a basic structure for automated strategies in JavaScript, Python, Rust, and C++. A main loop repeatedly runs strategy logic, while a sleep interval controls polling frequency in live trading and playback speed in backtests. Its examples show retrieving market data, logging a tick, and detecting a newly formed bar by comparing the latest bar timestamp with the prior one. A futures exchange example also selects a swap contract before polling.
The accompanying API reference groups functions for system control, logging, market data, trading, concurrency, Web3, and technical indicators. This is platform documentation rather than a trading method: it explains execution patterns and available interfaces but supplies no signal design, risk controls, or performance evidence. The sample that repeatedly submits buy orders is explicitly illustrative and unsafe as a live strategy. Actual behavior and API availability may depend on the platform, language, exchange, and execution environment.
Key ideas
- A strategy loop can call its logic repeatedly and use a sleep interval to control polling.
- The sleep interval affects polling frequency in live trading and backtest speed.
- A bar-driven loop can detect a new candle by comparing its timestamp with the previous one.
- The API reference covers market data, orders, logging, indicators, concurrency, and Web3 functions.
- The repeated-buy example is illustrative and should not be treated as a deployable strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.