Optimization engine
Seven ways to search your parameter space.
Every TradingTune run drives a real optimization algorithm, not a random sweep. Some are exhaustive, some learn as they go, one combines both. Here is how each method searches, what is happening under the hood, and when to reach for it. TPE is the default and fits most strategies.
Not sure which to pick?
- 3 or fewer parameters Brute Force
- 4 to 10 parameters Simulated Annealing
- 11 or more parameters TPE (Bayesian)
- You want the best from one run Bisection then TPE Refine
TradingTune picks one of these for you automatically the first time it sees a strategy. You can override it any time.
Every optimization method, explained
-
Recommended
TPE (Bayesian)
Builds a probabilistic model of what works and spends your cycles where the payoff is most likely.
Quality 5 of 5Speed 5 of 5O(N) How it works -
Bisection (Smart Search)
Brackets the best region of each parameter and zooms in, deterministically and resumably.
Quality 4 of 5Speed 5 of 5O(N) How it works -
Bisection then TPE Refine
Runs the full Bisection search, then hands the remaining budget to TPE to refine around the peak.
Quality 5 of 5Speed 3 of 5O(N log N + K log K) How it works -
Simulated Annealing
Wanders widely at first, then settles toward an optimum as the acceptance temperature drops.
Quality 4 of 5Speed 3 of 5O(N) How it works -
Brute Force
Tries every combination of every value. Definitive, but only practical for a few parameters.
Quality 5 of 5Speed 1 of 5O(N^k) How it works -
Sequential Improvements
Tweaks a single parameter each cycle in round-robin. Cheap, but blind to interactions.
Quality 2 of 5Speed 3 of 5O(N x k) How it works -
Random
Picks a fresh independent parameter set every cycle. No memory, hard to beat as a baseline.
Quality 3 of 5Speed 5 of 5O(N) How it works
Configure a run
Every method shares the same setup: give each numeric input a range, pick a target metric, then run. Ranges and results stay in your browser; only your daily cycle count syncs.
Set parameter ranges as JSON
JSONTradingTune stores each numeric input as min, max, step, and enabled. Import this to set every input's sweep at once. The live current value is read from TradingView and never stored.
{
"Fast MA Length": { "min": 5, "max": 50, "step": 5, "enabled": true },
"Slow MA Length": { "min": 20, "max": 200, "step": 10, "enabled": true },
"RSI Length": { "min": 7, "max": 21, "step": 1, "enabled": false }
} Choose what to optimize
JSONThe run's target metric and filters. The optimize direction is derived from the metric (maximize for net_profit, profit_factor, win_rate; minimize for max_drawdown). minTrades and minWinRate discard undersampled or degenerate cycles.
{
"targetMetric": "net_profit",
"targetDirection": "maximize",
"minTrades": 30,
"minWinRate": 0,
"excludeBuyHold": true
} What a completed run exports (results.csv key columns)
CSVEach run exports a ZIP of metadata.csv, params.csv, settings.csv, and results.csv. results.csv has one row per cycle: these are the core metric columns, followed by one column per enabled parameter, and re-imports for side-by-side comparison.
cycle,isBaseline,metric,netProfit,trades,winRate,profitFactor,drawdownPct,sharpe,Fast MA Length,Slow MA Length
0,true,1234.5,1234.5,142,0.58,1.90,12.4,1.21,20,100
7,,1789.2,1789.2,138,0.61,2.30,9.8,1.55,15,90 Try them on your own strategy
Install TradingTune and run any of these methods right inside TradingView's strategy dialog. Free tier, no API keys. A free account is required to run.
Add to Chrome, it's free