Skip to content
All library documents

Connecting FMZ Trading Bots Through MQTT, NATS, AMQP, and Kafka

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

Summary

This guide describes how separate FMZ live trading programs can exchange messages through a broker using MQTT, NATS, AMQP, or Kafka. It outlines a publish and subscribe architecture, with the trading programs as clients and a locally hosted or remote server relaying messages. The platform's Dial function connects a strategy to a chosen protocol and topic or queue. Examples demonstrate a single program publishing and reading messages, and two NATS clients publishing to each other's topics.

The article also explains a practical difference in AMQP queues: messages may remain available for later reading, including after a strategy restarts. It sketches uses such as coordinating strategies, sharing market alerts, supporting hedging, and synchronizing distributed systems. These are protocol integration examples rather than trading strategies or evidence of improved returns. Deployments require a running broker and Docker in the examples; the guide provides limited discussion of authentication, security, delivery guarantees, or failure handling, so those operational concerns need separate treatment before production use.

Key ideas

  • FMZ strategies can publish and subscribe to brokered messages through the Dial interface.
  • MQTT, NATS, AMQP, and Kafka provide different messaging options for strategy coordination.
  • Separate live programs can exchange information by publishing and subscribing to agreed topics.
  • AMQP queue messages can persist and be read after a strategy restarts.
  • The examples show connectivity and message exchange, not trading performance or complete production safeguards.

Tags

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