All indicators

SuperTrend Optimizer

Mar 20, 2022

Static chart image
SignalsDashboardVolatility

The SuperTrend Optimizer tool is designed to identify the most effective SuperTrend parameters by concurrently testing 102 different combinations of Multiplier (Factor) and ATR period. By evaluating performance in real-time, the indicator automatically plots the best-performing settings on the chart and provides a detailed breakdown of top results in a visual table.

Usage

The indicator can be used to bypass the manual "guess and check" process of finding ideal SuperTrend settings for specific assets or timeframes. Users define a base "Lower Threshold" for both the Factor and ATR length, and the script builds a range of 102 combinations from those starting points.

  • Automatic Plotting: By default, the script identifies the top-performing combination from the tested range and plots its SuperTrend line and signals directly on the price action.
  • Performance Table: A table displayed on the chart lists the top three (or all) parameter combinations in descending order of performance.
  • Manual Override: If you wish to use specific parameters while still viewing the optimization table, you can enable the "Plot Override" feature to display a custom SuperTrend regardless of the optimization results.

Details

The script executes 102 concurrent SuperTrend calculations. The optimization range is structured as follows:

  • Factor Range: Tests 34 variations starting from the user-defined base, incrementing by 0.1 (e.g., if set to 3.0, it tests up to 6.3).
  • ATR Range: Tests 3 variations starting from the user-defined base, incrementing by 1 (e.g., if set to 10, it tests 10, 11, and 12). The intersection of these ranges creates the 102 tested pairs. Performance is tracked bar-by-bar to determine which settings currently yield the best results based on trend following logic.

Settings

Set Lower Threshold for Parameter Optimization Range

  • SuperTrend Factor: Sets the starting point for the Multiplier range. The script tests this value plus the next 33 increments of 0.1.
  • SuperTrend ATR Length: Sets the starting point for the ATR period range. The script tests this value, plus the next 2 integer increments.

Table Config

  • Best Performers / Worst Performers: Toggle whether the table highlights the most or least successful parameter sets.
  • Show Performers: Choose to display only the "Top Three" or "All" tested combinations in the UI.
  • "Parameters Tested" Label: Toggles the visibility of the summary label.

Plot SuperTrend With Your Parameters

  • Plot Override SuperTrend: When set to "On," the script plots the SuperTrend using the "Override" inputs instead of the auto-optimized best performer.
  • Override SuperTrend Factor: The Multiplier used for the manual plot.
  • Override SuperTrend ATR Length: The ATR length used for the manual plot.

Visuals

  • Light Mode: Switches the table and UI colors for better visibility on light-colored chart themes.
  • Raining: A visual Easter egg that changes candle or background aesthetics (options include Candles, Crypto, Sunny Day, and Rocketship).

FAQ

How do I access the SuperTrend Optimizer? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

How many combinations does this script test? The script tests 102 unique combinations of SuperTrend parameters simultaneously.

Does changing the Override settings affect the optimization results? No, the override settings only change what is plotted on your chart; the optimization table continues to calculate based on the "Lower Threshold" group of settings.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.