Profitable Supertrend v0.1 - Alpha
Jan 25, 2023

The Profitable Supertrend v0.1 indicator is a testing tool designed to identify the most effective Supertrend parameter combinations by backtesting various settings over a specific historical period. It provides traders with a data-driven approach to selecting ATR factors and periods for their trend-following strategies.
Usage
The Usage section focuses on how the indicator processes different parameter sets to find optimal results. Users can set a specific start date to begin the evaluation, and the script will automatically iterate through a predefined range of Supertrend configurations.
- Identifying Best Parameters: The script calculates performance across various combinations and displays the most "profitable" result (highest win rate) in a table on the chart.
- Performance Metrics: The output table displays the total number of trades, the number of successful trades, the success percentage, and the specific Factor/Period combination that achieved those results.
Details
This script implements a brute-force evaluation method using Pine Script matrices. It tracks the outcome of trend shifts for multiple Supertrend instances simultaneously.
- ATR Factor Range: Evaluates factors from 3.0 to 12.0 with an increment of 0.2.
- ATR Period Range: Evaluates periods from 10 to 43 with an increment of 3.
- Success Logic: A trade is considered successful if the price at the end of a trend (when the direction flips) is favorable compared to the price at the start of that trend (e.g., price is higher at the end of an uptrend or lower at the end of a downtrend).
Settings
- Start Date Evaluation: Determines the timestamp from which the script begins collecting trade data for the parameter optimization.
FAQ
How do I use the results from this indicator?
Once the script has finished processing historical data, look at the table on your chart to find the "Factor/Period comb." value. You can then apply these specific values to a standard Supertrend indicator for your actual trading.
Why does the script take time to load?
The script evaluates a large matrix of over 40 parameter combinations simultaneously. Due to the computational intensity of calculating these within Pine Script's limits, it may experience slower loading times on charts with deep history.
How can I access Profitable Supertrend v0.1?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.