Run Backtest
Run a custom strategy backtest using the ConditionEngine. This is the core Strategy Builder endpoint.
Request
- Base URL: https://api.pruviq.com (the document declares no server; this is the origin it was published from)
- URL: https://api.pruviq.com/backtest
- Auth: none declared
Request body
short | long. Omitted → SHORT (the documented /backtest default). Unlike /simulate, which resolves an omitted direction from the strategy registry, /backtest has no strategy id to resolve from — send direction explicitly. The response's direction_source says whether it was sent or defaulted (Q-B82).
Indicator configs: {'bb': {'period': 20}, 'ema': {}, ...}
Entry conditions tree: {'type': 'AND', 'conditions': [...]}
Optional exit-signal conditions tree (same shape as entry). When met during an open trade, exit early (exit_reason='signal'). null = no signal exit (TP/SL/trailing/timeout only).
UTC hours to avoid (0-23)
Months to avoid entering trades (1-12). null = no month filter
Minimum ATR ratio (current ATR / 14-period ATR MA) to allow entry. e.g., 0.7 = skip low-volatility periods. null = no filter
Stop Loss %
Take Profit %
Exit mode: custom_pct = fixed TP/SL; trailing = trailing stop (tp_pct is the trail distance)
Trailing stop distance %. If null and tp_source=trailing, uses tp_pct.
Max holding period (bars)
Number of coins (null = top 50)
Specific symbols
Include stablecoins (USDC, DAI…) in the top_n universe. Default false — ~0 volatility → empty backtests. Ignored when symbols is set (explicit picks always honored).
Single-symbol alias for symbols. Auto-mapped (prevents silent ignore).
Backtest start date (YYYY-MM-DD)
Backtest end date (YYYY-MM-DD)
Candle timeframe: 1H, 2H, 4H, 6H, 12H, 1D, 1W
Fee per side (0.0005 = 0.05%). None = use market_type default
USD per coin position (compounding=True: total portfolio capital)
Leverage multiplier
Max simultaneous open positions
True = reinvest profits (compound), False = fixed position size (simple)
Response
Successful Response
False when the strategy failed validation and nothing was run — every metric is a placeholder (0), NOT a 0-trade result. validation_errors says why. HTTP stays 200 (documented contract).
«request» = the request sent direction; «default_short» = it was omitted and this run is SHORT (the /backtest default — /simulate would use the strategy registry's direction instead).
The top_n this run resolved to. null for explicit symbols= requests (no top-N universe).
Coins eligible for a top-N universe at run time (stablecoins unless include_stablecoins, non-crypto and liquidity-dead markets excluded), read in the same selection as the coins run. null for symbols= requests (and on /backtest when the strategy is invalid, is_valid=false).
eligible_universe < top_n_requested: the request asked for more coins than exist, so the whole eligible universe ran. A cap only — coins lacking data are reported in coins_missing_data. null for symbols= requests.
min(top_n_requested, eligible_universe) - (selected coins with at least one candle inside start_date..end_date). Counts selected coins with no complete candle up to the cutoff AND coins whose candles all fall outside the requested window (those stay in coins_used, so this can exceed min(top_n_requested, eligible_universe) - coins_used). null for symbols= requests.
계약은 build_reliability_warning 한 곳이 소유한다(룰3).
Changes
No recorded changes to this operation across all 2 revisions of this API.