Research and backtesting
Backtests, session statistics, relative strength, scans and snapshots.
backtest_strategy
Backtest a long or short condition strategy over closed bars with USDT position sizing, round-trip cost_bps (fees + slippage) and optional historical funding. Supported conditions: rsi_above, rsi_below, price_above_ema, price_below_ema, macd_cross_above_zero, macd_cross_below_zero. Signals evaluate at bar close; fills at that close; assumptions are echoed. Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/backtest_strategy
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
timeframe | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | yes | — | |
bars | integer | no | 1000 | |
strategy | object | yes | — | |
side | long | short | buy | sell | no | "long" | |
initial_balance_usdt | number | no | 10000 | |
position_size_usdt | number | no | — | |
position_pct | number | no | — | |
cost_bps | number | no | 10 | |
funding | boolean | no | false |
Example request:
{
"symbol": "BTC/USDT:USDT",
"timeframe": "M1",
"strategy": {}
}simulate_rule_template
Replay a hypothetical long/short on historical bars with and without a protection template (breakeven, trailing, or R-ratchet) — the SAME math the live worker and simulated matcher run. Per bar the adverse extreme is checked before the favourable one (conservative); stops tighten only. Reports R outcome with and without the template. Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/simulate_rule_template
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
timeframe | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | no | "H1" | |
side | long | short | buy | sell | yes | — | |
entry_price | number | no | — | |
stop_loss | number | yes | — | |
take_profit | number | no | — | |
bars_after_entry | integer | no | 100 | |
entry_bars_ago | integer | no | 100 | |
template | any | yes | — |
Example request:
{
"symbol": "BTC/USDT:USDT",
"side": "long",
"stop_loss": 0,
"template": "<template>"
}get_session_stats
Historical per-session behaviour from H1 bars over fixed UTC windows (asia 00-08, london 07-16, new_york 13-22, weekend Sat-Sun). Ranges and drift in bps of price; bias, breakout continuation and reversal percentages; sample_days with insufficient_samples below 20. Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/get_session_stats
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
session | asia | london | new_york | weekend | yes | — | |
days | integer | no | 60 |
Example request:
{
"symbol": "BTC/USDT:USDT",
"session": "asia"
}get_symbol_session_profile
Per (symbol, session) profile from M15 bars: typical range (median/p80), drift, typical minute of the extreme, and sensitivity to high-impact USD events. Includes the weekend pseudo-session (crypto trades 24/7 but weekend liquidity differs). Buckets under 10 samples report insufficient_samples. Units: bps of price. Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/get_symbol_session_profile
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
session | asia | london | new_york | weekend | yes | — | |
days | integer | no | 30 |
Example request:
{
"symbol": "BTC/USDT:USDT",
"session": "asia"
}get_relative_strength
Rank a universe (default: the connection's trade universe via get_trade_universe; scope:"exchange_top" ranks the top USDT markets of the connection's market type by 24h volume instead) by % change over the last N bars, both raw and volatility-normalised (change / ATR%), strongest first. vs:"BTC" ranks the change relative to BTC. low_confidence when fewer than 30 bars. Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/get_relative_strength
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
universe | string[] | no | — | |
symbols | string[] | no | — | |
scope | universe | exchange_top | no | "universe" | |
top_n | integer | no | 20 | |
timeframe | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | no | "H4" | |
bars | integer | no | 24 | |
vs | USDT | BTC | no | "USDT" |
Example request:
{}get_market_snapshot
One-call overview: tick plus up to 6 indicators across up to 4 timeframes (current closed-bar values). Defaults: RSI14, EMA20, ATR14 over M15/H1/H4/D1. Raw values. Available on every tier.
Capability: read · read-only · REST: POST /v1/tools/get_market_snapshot
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
indicators | object[] | no | [{"indicator":"RSI"},{"indicator":"EMA"},{"indicator":"ATR"}] | |
timeframes | string[] | no | ["M15","H1","H4","D1"] |
Example request:
{
"symbol": "BTC/USDT:USDT"
}scan_symbols
Scan a universe (given symbols; otherwise the connection's trade universe, or with scope:"exchange_top" the top-N USDT markets by 24h volume) with filters: spread_bps_max, rsi_above/rsi_below, atr_pct_above/atr_pct_below (on the chosen timeframe), min_quote_volume_24h, funding_abs_above (perps). Returns matches with the metrics used, order:"quote_volume_desc"; symbols whose data is unavailable are listed in missing_inputs, never silently passed. Available on every tier.
Capability: read · read-only · REST: POST /v1/tools/scan_symbols
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbols | string[] | no | — | |
scope | universe | exchange_top | no | "universe" | |
market_type | spot | swap | no | — | |
top_n | integer | no | 30 | |
timeframe | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | no | "H1" | |
spread_bps_max | number | no | — | |
rsi_above | number | no | — | |
rsi_below | number | no | — | |
atr_pct_above | number | no | — | |
atr_pct_below | number | no | — | |
min_quote_volume_24h | number | no | — | |
funding_abs_above | number | no | — |
Example request:
{}get_spread_alert
Compare each symbol's current spread (bps) with its own rolling median of recorded tickers; alert when current >= threshold_multiple × median. Needs at least 20 recorded samples, otherwise insufficient_history (no estimate is invented). Requires the analytics capability (Pro and above).
Capability: analytics · read-only · REST: POST /v1/tools/get_spread_alert
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbols | string[] | yes | — | |
threshold_multiple | number | no | 3 |
Example request:
{
"symbols": []
}get_state_delta
What changed since the last call with the same cursor_id (per account + connection + symbol): price move since baseline, new closed bars, position/order count changes. The first call establishes the baseline and returns baseline_created:true. Available on every tier.
Capability: read · read-only · REST: POST /v1/tools/get_state_delta
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
symbol | string | yes | — | Canonical ccxt symbol: BTC/USDT:USDT (perp) or BTC/USDT (spot). Aliases like BTCUSDT are accepted and the canonical symbol is echoed. |
cursor_id | string | no | "default" | |
timeframe | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | no | "M15" |
Example request:
{
"symbol": "BTC/USDT:USDT"
}