Optimization
When signals are used to perform a backtest, the Backtester is able to return the Sensitivity setting that maximized a user specified statistic such as net profit, winrate, profit factor, or maximum drawdown.
Certain settings will disable the optimization procedure, such as disabling the backtesting window or using autopilot.
Procedure
Users can choose to optimize net profit, winrate, profit factor, potential ratio or maximum drawdown depending on the options selected from the Optimize drop-down menu within the OPTIMIZER settings section.
The overall profit or loss achieved (higher is better).
The overall profit or loss achieved (higher is better).
The percentage of winning trades (higher is better).
The gross profits over gross losses generated by the strategy (higher is better). A value higher than 1 suggest that the strategy generated more profits than losses.
The greatest decline of the strategy relative to the highest net profits (Lower is better).
A lower value is indicative of a strategy less subject to large downside variability.
The ratio between the sum of maximum potential profits you could have made in your trades over the sum of maximum potential losses you could have made in your trades (higher is better).
Higher values indicates that the entries generated by the strategy have the potential to lead to larger profits compared to losses. Lower values however might be indicative of a more risky strategy, with more frequent exposure to larger potential losses.
If the backtest with the highest potential ratio is not the one with the highest potential profit then it can be indicative of a strategy with more potential with a tendency to exit trades potentially too late.
Optimization can be performed on any given range for the Sensitivity setting.
Optimizing the Sensitivity setting using a large range of values and/or using a large backtest window can increase computation time, potentially returning time-out errors.
Results from the optimizer can vary from the backtest results returned by the strategy, this is due to the difference between how the Tradingview backtesting engine opens positions compared to the internal engine used to perform optimization within the script. Using different signal algorithms for long/short entry rules can return very different results from the optimizer compared to backtesting results.
Take profits and/or stop losses orders are taken into account by the internal engine if these are enabled, however, there can still exist a great degree of disparity between results from the backtest and results returned by the optimizer.
Warmup Period
The warmup period allows the script to compute the signal algorithms n bars prior to the backtesting window, where n is the selected warmup period. This allows to backtest signals that are closer to the ones returned by the Signals & Overlays® toolkit, returning more accurate optimized settings as a result.
Optimization Dashboard
Users can see the backtests results for sensitivity values within the specified optimization range on a dashboard shown on the top-right of their chart. This dashboard presents results in descending order, with results associated to the best optimized statistic appearing on top.
Simple
Users that do not wish to have a large dashboard on the chart can use the Simple optimization dashboard. This dashboard will only return the Sensitivity setting that optimize the selected statistic alongside the statistic of interest.
Display
Users can control the location as well as hide the optimization dashboard on the chart from the DISPLAY settings section.
A dashboard location set to None will hide it from the chart as well as disable the optimizer.
Was this page helpful?