Solution · Quant Trading
Market Data for Quant Trading: From Backtest to Live Execution on One API
Backtest on historical K-lines and ticks, then go live on the same symbols over WebSocket. iTick unifies stocks, forex, crypto, indices and futures in one format, so your research code and your execution gateway never need a second data vendor.
- Historical OHLCV and ticks for Backtrader, VectorBT and vn.py
- WebSocket quote, tick and Level 2 depth for live signals
- Cross-market spread and arbitrage monitoring
- US, HK, A-shares, forex, crypto and futures - one symbol format
import requests, pandas as pd
H = {"accept": "application/json", "token": "YOUR_API_TOKEN"}
def bars(asset, region, code, ktype=8, limit=1000):
r = requests.get(f"https://api.itick.org/{asset}/kline", headers=H,
params={"region": region, "code": code, "kType": ktype, "limit": limit})
df = pd.DataFrame(r.json()["data"]).rename(columns={"t": "time", "o": "open",
"h": "high", "l": "low", "c": "close", "v": "volume"})
df["time"] = pd.to_datetime(df["time"], unit="ms")
return df.set_index("time")
# Same loader for stocks, forex and crypto - one data source for every backtest
df = bars("stock", "US", "AAPL")
df["fast"], df["slow"] = df.close.rolling(10).mean(), df.close.rolling(30).mean()
df["pos"] = (df.fast > df.slow).astype(int).shift()
equity = (1 + df.close.pct_change() * df.pos).cumprod()
print("strategy return:", round(equity.iloc[-1] - 1, 4))
# Feed df straight into Backtrader (bt.feeds.PandasData), VectorBT or vn.pyWhat you can build
Three building blocks most quant teams need, all on the same data.
Strategy backtesting platform
Pull multi-year daily bars or intraday minute bars for any supported market and load them into Python or Java backtest frameworks.
Live execution gateway
Subscribe to quote, tick and depth; when a signal fires, route the order to your broker or trading counter.
Multi-market arbitrage monitor
Compare prices and order books across markets - spot vs futures, ETF vs underlying - and alert when spreads widen.
Any strategy style
Intraday, grid, mean reversion, moving-average crossover, RSI or martingale - the data feed is strategy-agnostic.
No exchange-by-exchange integration
One token and one JSON format instead of separate connections to every venue.
Research equals production
The symbols and fields you backtest on are the ones you trade on, so live results match research.
Reference architecture
How quant teams wire iTick into the strategy lifecycle.
- 1
Collect history
REST /kline and tick history into Parquet or a database.
- 2
Backtest
Run the strategy in Backtrader, VectorBT or vn.py on the stored bars.
- 3
Stream live
WebSocket quote / tick / depth for the same symbols.
- 4
Signal and execute
Strategy engine emits orders to your broker or trading counter.
Data you need, endpoint you call
Everything is available on the same token.
| Need | iTick API | Typical use |
|---|---|---|
| Daily / weekly / monthly bars | REST /{asset}/kline kType 8-10 | Swing and position backtests |
| Intraday bars | REST /{asset}/kline kType 1-7 | Intraday backtests and signals |
| Tick-by-tick trades | REST /{asset}/tick, WebSocket tick | Microstructure and HFT research |
| Order book depth | REST /{asset}/depth, WebSocket depth | Execution, slippage modelling |
| Real-time quotes | WebSocket quote | Live signals and risk checks |
From research to live in Python
One loader for every market, then the same symbols streamed live.
- Get a free API token
- Download history and backtest
- Subscribe over WebSocket and trade the signal
import requests, pandas as pd
H = {"accept": "application/json", "token": "YOUR_API_TOKEN"}
def bars(asset, region, code, ktype=8, limit=1000):
r = requests.get(f"https://api.itick.org/{asset}/kline", headers=H,
params={"region": region, "code": code, "kType": ktype, "limit": limit})
df = pd.DataFrame(r.json()["data"]).rename(columns={"t": "time", "o": "open",
"h": "high", "l": "low", "c": "close", "v": "volume"})
df["time"] = pd.to_datetime(df["time"], unit="ms")
return df.set_index("time")
# Same loader for stocks, forex and crypto - one data source for every backtest
df = bars("stock", "US", "AAPL")
df["fast"], df["slow"] = df.close.rolling(10).mean(), df.close.rolling(30).mean()
df["pos"] = (df.fast > df.slow).astype(int).shift()
equity = (1 + df.close.pct_change() * df.pos).cumprod()
print("strategy return:", round(equity.iloc[-1] - 1, 4))
# Feed df straight into Backtrader (bt.feeds.PandasData), VectorBT or vn.pyQuant trading data FAQ
Which backtesting frameworks work with iTick?
Any framework that accepts a pandas DataFrame or CSV, including Backtrader, VectorBT, vn.py, Zipline-style engines and custom Java backtesters.
Can I backtest on tick data?
Yes. Tick-by-tick trades and order book depth are available for supported markets, alongside 1-minute to monthly K-lines.
Does iTick execute orders?
No. iTick is a market data provider. Your strategy engine consumes iTick data and sends orders to your broker or trading system.
Can one plan cover stocks, forex and crypto?
Yes. The integrated plans cover stocks, forex, metals, indices and crypto on one token; see the pricing page for limits.
Backtest today, trade the same data tomorrow
Start with a free API key and move to a paid plan when your strategy goes live.