Solution · Infrastructure
Market Data Infrastructure: Distribution, Replay, Indicators and Reference Data
As more teams consume market data, a few shared services pay for themselves. Forward one iTick subscription to every internal system, replay history on demand, compute indicators in one place, and keep instrument metadata consistent across the company.
- Fan-out to Redis or Kafka to save subscription quota
- Tick and K-line replay for EA tests and stress scenarios
- One indicator service for MA, MACD, BOLL and ATR
- Exchanges, trading sessions and symbol metadata
# iTick -> Redis Pub/Sub (or Kafka): one subscription, many internal consumers
import json, websocket, redis # pip install redis websocket-client
r = redis.Redis()
def on_message(ws, msg):
d = json.loads(msg).get("data") or {}
if d.get("s"):
r.publish(f"md.{d['s']}", msg) # consumers: risk, UI, strategies, storage
r.hset("md:last", d["s"], msg) # latest snapshot for late joiners
websocket.WebSocketApp("wss://api.itick.org/stock", header={"token": "YOUR_API_TOKEN"},
on_open=lambda ws: ws.send(json.dumps({"ac": "subscribe",
"params": "AAPL$US,TSLA$US,700$HK", "types": "quote,tick,depth"})),
on_message=on_message).run_forever(ping_interval=20)
# Kafka: replace r.publish with producer.send("market-data", key=sym, value=msg)Four supporting services
Small services that make every other system simpler.
Market data forwarding
iTick to internal MQ (Redis or Kafka) so many services consume one upstream connection and stay within subscription limits.
Market replay
Replay historical ticks and K-lines to reproduce market events, test EAs and run risk stress tests.
Indicator calculation service
Compute MA, MACD, BOLL, ATR and more centrally from raw ticks and bars, and serve identical values to every team.
Instrument metadata
Exchanges, trading hours, contract multipliers, tick sizes and session calendars from the symbol list API.
Access control
Your gateway decides which team sees which markets while iTick credentials stay in one place.
Observability
Measure message rates, gaps and latency at a single choke point.
Shared market data layer
One upstream, consistent data for every consumer.
- 1
iTick feed
WebSocket for live data, REST for history and symbols.
- 2
Forwarder
Publish to Redis or Kafka topics per symbol.
- 3
Shared services
Replay, indicators and metadata APIs.
- 4
Consumers
Strategies, risk, UI, storage and analytics.
Building blocks in Python
Fan-out, replay and an indicator service you can adapt in minutes.
- Get a free API token
- Deploy the forwarder next to your MQ
- Point every consumer at internal topics
# iTick -> Redis Pub/Sub (or Kafka): one subscription, many internal consumers
import json, websocket, redis # pip install redis websocket-client
r = redis.Redis()
def on_message(ws, msg):
d = json.loads(msg).get("data") or {}
if d.get("s"):
r.publish(f"md.{d['s']}", msg) # consumers: risk, UI, strategies, storage
r.hset("md:last", d["s"], msg) # latest snapshot for late joiners
websocket.WebSocketApp("wss://api.itick.org/stock", header={"token": "YOUR_API_TOKEN"},
on_open=lambda ws: ws.send(json.dumps({"ac": "subscribe",
"params": "AAPL$US,TSLA$US,700$HK", "types": "quote,tick,depth"})),
on_message=on_message).run_forever(ping_interval=20)
# Kafka: replace r.publish with producer.send("market-data", key=sym, value=msg)Infrastructure FAQ
Why forward market data internally?
One upstream subscription fanned out through Redis or Kafka avoids hitting connection and symbol limits, and gives every service the same timestamps.
Can I replay ticks, not only bars?
Yes, for markets where tick history is available. Store ticks from the WebSocket feed or fetch history, then replay them with the original timing.
Does iTick provide indicators?
Technical indicators are listed among plan features; many teams also compute their own centrally from raw OHLCV for full control, as shown above.
Where does instrument metadata come from?
The symbol list API returns codes, names and exchanges per market; combine it with exchange session calendars for trading hours.
Build a market data layer your whole team can share
Start with a free key, then scale limits as more systems connect.