Skip to content
All library documents

Running a Python Trading Strategy from Local Files on FMZ

Article FMZ digest · Author: 发明者量化-小小梦

Summary

This article explains how to run a Python strategy whose main logic resides in a local file on the machine hosting an FMZ trading robot. Its example uses a Dual Thrust futures strategy. One approach imports a local module and passes in the platform’s exchange objects, functions, constants, and strategy parameters through setup interfaces. A second approach reads and executes the local strategy file directly, with matching parameters configured in the platform startup strategy.

The article compares backtests of the locally loaded strategy with the original platform-hosted version and reports that the results are consistent, though it gives no detailed metrics. The technique is about code organization and deployment rather than improving the trading method. It depends on the platform runtime, local file paths, and access to the platform’s global objects; the article does not address broader security controls or demonstrate that local storage alone protects strategy code. It recommends direct file execution as the simpler of its two examples.

Key ideas

  • A local Python module can receive platform objects, functions, constants, and parameters through explicit setup functions.
  • A startup strategy can load local code from the machine running the trading robot.
  • Directly reading and executing a local file is presented as a simpler alternative to importing a module.
  • The example compares local-file backtests with the original strategy and reports matching results without detailed metrics.
  • The method depends on the platform runtime and correctly configured local paths and parameters.

Tags

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