Sweep a strategy’s parameters across ranges, let AskFutures test the grid, and find the best combination by the metric you care about — without overfitting.
Optimization sweeps your strategy’s tunable numbers across ranges, runs a
backtest for every combination, and reports the one that scored best on the metric
you chose. You pick the parameters and the ranges; AskFutures runs the grid and
ranks the results.
Every run in a sweep is a normal, deterministic backtest — same real prices,
same modeled costs. Optimization just runs many of them and compares the
numbers. The AI doesn’t decide what’s “best”; the simulator does the math and
the metric does the ranking.
Any tunable number on the strategy card — an EMA period, a stop size, a target,
an ATR multiple. Hold the rest fixed.
2
Set a range for each one
Give a min, a max, and either a step or a number of test points.
For example, sweep the stop from 200to600 in $100 steps (5 values), or the
fast EMA from 5 to 15.
3
Choose the metric to optimize
Best average P&L per trade, best total P&L, best win rate — whatever defines
“better” for your idea.
4
Run it
AskFutures backtests every combination in the grid and reports the winning
parameter set, with the full table available to download.
The strategy card shows the size of the job before you commit — something like
“1 parameter · 10 runs” — and you can switch each range between an evenly spaced
count (Num. steps) or your own explicit values (Custom), on a linear or
log scale. Two ranges multiply: a 5-value stop sweep crossed with a 4-value
target sweep is 20 backtests.
Two-tier sweeps: why some changes are fast and some are slow
Under the hood, a sweep is organized in two tiers — an outer loop and an
inner loop — and which tier a parameter lands in is why some sweeps fly and
others take a while.
Inner = fast
Parameters that only affect how trades are managed — stop size, target,
trailing stop, max time in trade. The indicators don’t change, so the engine
reuses them and just re-simulates the exits. Many values, cheaply.
Outer = slower
Parameters that change an indicator itself — an EMA period, an RSI length,
an ATR window. Every value forces the indicators to be recomputed across the
whole window before the trades can run. Fewer values, more work each.
Want a big sweep without a long wait? Put your wide ranges on the inner
parameters (stops and targets) and keep the outer parameters (indicator
lengths) to a handful of values.
Optimize after a strategy already backtests cleanly and shows a plausible
edge — to refine it, not to rescue it.
Good time to optimize
The strategy passes its backtest, takes a sensible number of trades, and the
average P&L per trade is around break-even or better. Now you’re asking “is
there a better stop, or a slightly different EMA pair?” — a refinement.
Not yet
The strategy fails to run, takes a handful of trades, or loses badly across the
board. No range of stop sizes fixes a broken idea — fix the logic in chat
first, then sweep.
A sweep finds the parameters that fit the past best — which is not the same
as the parameters that will work next. The more combinations you try, the more
likely the “winner” is just the one that happened to line up with old noise.
Treat the best result as a hypothesis, not a guarantee.Guard against it:
Prefer wide, robust plateaus over a single razor-thin peak. If only one
exact value works and its neighbors fall apart, that’s a red flag.
Keep sweeps small and meaningful — a few parameters, sensible ranges.
Re-test the winner on a different window (e.g. a more recent stretch you
didn’t sweep over) before you trust it.
Past performance does not guarantee future results. Always test before you trade.
Each sweep finishes as a labelled batch — e.g. “Optimization 1 · Completed · 6
combinations · Best: $-2.97 avg” — naming the winning parameters and the score on
your chosen metric. Open it to see the ranking, or download the full table as a CSV
to compare every combination yourself.
Found a winner you like? Ask AskFutures to apply it. The chosen parameters become
a new saved version of the strategy, so you can compare
it against the original.