Backtests

Run a Grid-Trading backtest (sync)

KuCoin-konformer Grid-Trading-Backtest (spot, 15-min candles). Eigenes Trade-Modell mit per-level coinSize-Allokation. Optional leverage 2/3/5 (grid_mode long only, API Pro): isolated-margin long grid — margin = total_investment, the grid trades margin × leverage, funding accrues daily on the open position, by default with an initial position at the start (start_rule), liquidation checked per candle at the low; result then carries liquidated / liquidation_time / liquidation_price / funding_cost_usd / funding_fell_back_to_conservative / max_notional_exposure and final_value is equity on the margin. Simulates, does not recommend. Free: BTCUSDT/ETHUSDT, 1x only. [Free / API Pro tier]

post/api/v1/backtests/grid

Request

  • Base URL: https://tradingstrategies.work
  • URL: https://tradingstrategies.work/api/v1/backtests/grid
  • Auth: HTTP bearer

Request body

pairstring required
start_datestring date required
end_datestring date required
total_investmentnumber required

USDT; with leverage > 1 this is the margin.

low_pricenumber required
high_pricenumber required
grid_countinteger required
grid_type'arithmetic' | 'geometric' required
grid_mode'neutral' | 'long'
fee_ratenumber required
entry_pricenumber
stop_loss_pricenumber
take_profit_pricenumber
stop_on_range_exitboolean

Default false: the grid pauses outside the range and resumes when price returns. true: the first candle CLOSING outside low..high sells all coins at that close and ends the run (stop_reason range_exit_high/low).

leverage1 | 2 | 3 | 5

Grid-Leverage v1: > 1 requires grid_mode long and API Pro.

funding_mode'none' | 'conservative' | 'historical'

Only with leverage > 1. historical = BTCUSDT from 2019-09-08, otherwise conservative fallback (flagged).

start_rule'initial_position' | 'cash'

Only with leverage > 1. initial_position = exchange rule of a futures long grid: one grid amount bought at the entry price for every level above the entry (position, funding and liquidation risk from the first candle). cash = start 100% in cash, buy only on dips.

Response

Grid backtest result with profit-per-grid statistics (leverage fields only when leverage > 1).

Changes

No recorded changes to this operation across all 1 revision of this API.