Plain-language definitions
Strategy optimization glossary.
Every term you will meet while optimizing TradingView strategies with TradingTune, defined in plain language. From the basics of cycles and parameter ranges to the metrics you read in the results table and the search methods that find your settings.
Optimization basics
- Optimization cycle
- One trial in an optimization run. TradingTune sets a single combination of parameter values, runs the backtest, and records the result. The free tier allows 10 cycles per day, and Pro removes the daily limit.
- Parameter
- An adjustable input of a strategy, such as a moving-average length or a stop-loss percentage. Optimization searches for the parameter values that perform best on your data.
- Parameter range (min, max, step)
- The set of values the optimizer is allowed to try for a parameter, defined by a minimum, a maximum, and a step size between them. Wider ranges and finer steps create a much larger search space.
- Backtest
- A simulation of how a strategy would have performed on historical price data. Every optimization cycle runs one backtest. See real backtests compared to buy and hold . A backtest measures the past only and does not guarantee future results.
Robustness and validation
- In-sample vs out-of-sample
- In-sample data is the period you optimize on. Out-of-sample data is a later period the optimizer never saw, used to check whether tuned settings generalise. Learn how to use this to avoid overfitting , or the full workflow in in-sample vs out-of-sample .
- Walk-forward
- A validation approach where you optimize on one window, test on the period right after it, then roll both windows forward and repeat. Consistent out-of-sample performance across each fresh window is strong evidence of a durable edge. See walk-forward analysis .
- Overfitting (curve-fitting)
- Tuning a strategy so tightly to one slice of history that it learns the noise rather than a repeatable pattern. Overfit settings look great in the backtest and tend to fail live. Our guide to avoiding overfitting covers the warning signs and the fixes.
Result metrics
- Net profit
- The total profit or loss a parameter combination produced over the backtest period. The headline metric in the results table, but best read alongside drawdown, Sharpe, and trade count.
- Win rate
- The share of trades that closed in profit. A high win rate can still lose money if the losses are large and the wins small, so read it together with net profit and drawdown.
Win rate
PythonThe share of closed trades that ended in profit, between 0 and 1.
# Share of closed trades that ended in profit (0 to 1). win_rate = winning_trades / total_trades # Example: 82 winners out of 142 trades 82 / 142 # 0.577 - Profit factor
- Gross profit divided by gross loss. Above 1 means the wins outweighed the losses, and many traders look for 1.5 or higher. Read it together with trade count and max drawdown, since a tiny sample can inflate it.
Profit factor
PythonDollars of gross profit earned per dollar of gross loss. Above 1 is net positive.
# Gross profit per unit of gross loss. Above 1 is net positive. profit_factor = gross_profit / abs(gross_loss) # Example: 5400 in winners against 2850 in losers 5400 / 2850 # 1.89 - Max drawdown
- The largest peak-to-trough drop in equity over the backtest. It represents the worst-case loss on paper, and a smaller drawdown is often worth accepting a slightly lower net profit for.
Max drawdown
PythonThe largest peak-to-trough equity drop, as a fraction of the prior peak.
# Largest peak-to-trough drop in equity, as a fraction of the prior peak. def max_drawdown(equity): peak, mdd = equity[0], 0.0 for value in equity: peak = max(peak, value) mdd = max(mdd, (peak - value) / peak) return mdd max_drawdown([100, 120, 90, 130, 110]) # 0.25 - Expectancy
- The average profit or loss you can expect per trade, blending win rate with the size of the average win and average loss. A strategy with positive expectancy makes money over enough trades even if its win rate is below half.
Expectancy per trade
PythonAverage profit or loss per trade, weighting wins and losses by their frequency.
# Average profit (or loss) per trade. expectancy = win_rate * avg_win - (1 - win_rate) * avg_loss # Example: 58% winners averaging 120, 42% losers averaging 95 0.58 * 120 - 0.42 * 95 # 29.7 - Trade count
- How many trades a combination took during the backtest. Too few trades and the other metrics are mostly luck, so prefer results backed by a meaningful sample size. See how many trades is enough .
Optimization methods
- Brute force
- An exhaustive search that tries every combination of every parameter value. It guarantees the best result within your ranges, but is only practical for a few parameters. See the brute force method .
- Simulated annealing
- A probabilistic search that explores widely at first, then settles toward an optimum as it cools, letting it escape shallow local optima on bumpy landscapes. See the simulated annealing method .
- Bisection
- A fast, deterministic search that brackets the best region of each parameter with a coarse sweep, narrows in with golden-section steps, then polishes the top values. See the bisection method .
- TPE (Bayesian)
- Tree-structured Parzen Estimator, a Bayesian sampler that builds a model of which settings work and spends cycles where the payoff is most likely. It is TradingTune's default. See the TPE Bayesian method .
Where to go next
Now that the vocabulary is clear, see how to choose a strategy optimizer against the criteria that matter, or learn more about TradingTune and the local-first model behind it.
Put the terms to work
Install TradingTune and optimize any TradingView strategy right in your browser. Free tier, no API keys. A free account is required to run.
Add to Chrome, it's free