Skip to content
All library documents

Using a Go Protocol Plugin for Concurrent Market Data Polling

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

Summary

The article describes a way to collect exchange ticker data concurrently while a JavaScript trading strategy runs. A separately compiled Go program acts as a protocol plugin and repeatedly requests market data, stores the latest ticker response, and serves it through an HTTP endpoint. The JavaScript example starts the background process, polls for its current value at intervals, then sends a termination request. The design separates continuous data collection from the strategy loop and illustrates basic create, read, and stop control messages.

The example targets a cryptocurrency ticker endpoint and includes implementation code for HTTP requests, JSON handling, and cancellation. It is presented as an experimental demonstration rather than a production-ready system. It gives no latency benchmarks or reliability measurements, and omits a discussion of rate limits, stale-data handling, reconnection behavior, authentication, and safe TLS configuration. The approach may be useful as an integration pattern, but those operational concerns would need attention before relying on it in live trading.

Key ideas

  • A separately compiled Go service can poll an exchange ticker while a JavaScript strategy runs.
  • A protocol endpoint supports commands to start collection, retrieve the latest ticker, and stop collection.
  • The JavaScript loop periodically requests the stored market data rather than waiting for each exchange request.
  • The article demonstrates an integration pattern but provides no latency or reliability evidence.
  • Rate limiting, stale data, reconnects, authentication, and transport security are not fully addressed.

Tags

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