Simulate Optimize

SL/TP grid search — runs up to 36 simulations with different SL/TP pairs.

post/simulate/optimize

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/simulate/optimize
  • Auth: none declared

Request body

strategystring

Strategy ID

directionstring nullable

long | short | both

sl_stepsnumber[]

Stop Loss values to sweep (max 6)

tp_stepsnumber[]

Take Profit values to sweep (max 6)

max_barsinteger
market_type'futures' | 'spot'
symbolsstring[] nullable
top_ninteger nullable

Limit coins for speed (default 20)

start_datestring nullable
end_datestring nullable
timeframe'1H' | '2H' | '4H' | '6H' | '12H' | '1D' | '1W'
metricstring

Primary metric: total_return_pct | win_rate | profit_factor | sharpe_ratio

Response

Successful Response

strategystring required
directionstring required
metricstring required
sl_stepsnumber[] required
tp_stepsnumber[] required
coins_usedinteger required
top_n_requestedinteger nullable

The top_n this run resolved to. null for explicit symbols= requests (no top-N universe).

eligible_universeinteger nullable

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).

universe_cappedboolean nullable

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.

run_capinteger nullable

Q-B131: the per-request limit that actually stopped this run before min(top_n_requested, eligible_universe) coins, or null when none did (coins_used then reaches that number, data gaps aside). See run_cap_reason for which limit.

run_cap_reason'indicator_cache' | 'compare_max_coins' nullable

Q-B131: which limit run_cap is. «indicator_cache»: the cached path of /simulate/compare, /simulate/validate and /simulate/optimize computes at most the indicator-cache size per request (no all-coin hold; larger runs are a separate async path, Q-B132). «compare_max_coins»: kept for compatibility — since Q-B55 /simulate/compare rejects a top_n above its limit (COMPARE_MAX_COINS) with HTTP 400, so this cut no longer binds. When both apply, the smaller one — the one that bound — is reported. null when no limit bound.

coins_not_computedstring[]

Q-B131: explicitly requested symbols= that were not run because the per-request compute limit (the indicator-cache size) was reached. Empty when every requested symbol ran. Distinct from coins_missing_data (coins without candles in the window).

data_rangestring required
compute_time_msinteger required

Changes

No recorded changes to this operation across all 2 revisions of this API.