Skip to content
All library documents

Scheduling Trading Robots with Timed Start and Stop Calls

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

Summary

The document describes a Python utility that starts and stops other trading robots at configured times through a platform's extension API. Each schedule entry identifies a robot and its daily start and stop times. The controller parses these entries, checks the local clock in a loop, and calls the corresponding restart or stop operation once per day, while displaying status information and logging API responses. The example is aimed at markets such as commodity futures, where trading is limited to particular sessions and running a robot continuously may be unnecessary.

This is an operations tool rather than a trading strategy: it does not specify signals, orders, or performance evidence. The implementation tracks whether each daily action has been attempted, but the article explicitly notes that it lacks checks for successful startup, exception handling, and retry behavior. Its timing logic is a basic reference and would need careful adaptation to time zones, session calendars, missed calls, and API failures before being relied on in production.

Key ideas

  • A schedule entry pairs a robot identifier with daily start and stop times.
  • A looping controller checks the clock and invokes platform API calls when scheduled times arrive.
  • Daily flags prevent repeated start or stop calls after the corresponding action is triggered.
  • The utility can reduce runtime for robots that only need to operate during market sessions.
  • The example omits startup verification, exception recovery, and retry handling.

Tags

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