Handling API Results in FMZ C++ Trading Strategies
Summary
This guide explains a key difference between JavaScript and C++ strategies on the FMZ Quant Trading Platform: how API calls signal failure. In JavaScript, a failed ticker request returns null, so a strategy can test whether the result exists before using it. In C++, the call returns an object in either case, and the strategy should inspect the object’s Valid property to determine whether the data is usable. The same validity-checking convention applies to returned objects more broadly.
The document also clarifies that FMZ’s C++ strategy entry point is named main and returns void, despite the conventional C or C++ program entry point having a different signature. Its example demonstrates platform checks, log resets, numeric formatting, profit logging, and wrapped API calls. These are platform-specific programming conventions rather than trading methods. The guide gives illustrative snippets but does not discuss strategy design, execution performance, or safeguards beyond checking validity and terminating when the platform version check fails.
Key ideas
- In FMZ JavaScript, a failed ticker request is represented by null.
- In FMZ C++, check the returned object’s Valid property to determine whether an API call succeeded.
- The FMZ C++ strategy entry function is a void main function, distinct from a standard program entry point.
- The examples show platform checks and logging utilities but provide no evidence about trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.