Adaptive Trend Finder

Overview
Adaptive Trend Finder is a Pine Script v6 indicator for TradingView that visualizes adaptive regression channels across short, mid, and long horizons. For each horizon it selects the period with the highest Pearson’s R to the log of price, then draws a midline and deviation bands. Optional table rows summarize the selected period, a plain-language trend-fit label (from R), and an Annualized Price Change metric for daily/weekly charts (descriptive of historical price movement only).
How It Works
The indicator computes logarithmic linear regressions for short (~20–200 bars), mid (~200–1100 bars), and long (~300–1200 bars) horizons using built-ins like math.log and math.exp. For each horizon, it picks the candidate period with the highest Pearson’s R, then uses the slope, intercept, and standard deviation to plot:
• Midline (regression)
• Upper/lower bands (default multipliers: 2.0 / 2.5 / 3.0)
Channel color can follow price-action (close vs. previous close), direction (sign of slope), or a fixed color.
Key Features
• Adaptive channels: period auto-selection per horizon using Pearson’s R.
• Flexible visuals: configurable band multipliers, styles, and transparency.
• Readable stats: optional table for selected period, R-based trend-fit label, and Annualized Price Change (historical/descriptive; optional).
• Clean display: channels can extend left/right or not at all; table position and text size are configurable.
What It Displays
Three regression channels (short/mid/long) with configurable coloring, plus optional table rows describing the selected period and how closely the regression fits recent data (via R). This is a chart-visualization tool intended to help review historical trend behavior across timeframes.
Use Notes
Examples of chart review tasks include examining channel slope/width, noting where price interacts with bands, and comparing short vs. longer-term channels for context. This indicator does not generate signals or trade recommendations.
Configuration Notes
Adjust deviation multipliers (defaults: 2.0 / 2.5 / 3.0), line styles/colors, and toggle short/mid/long channels. Choose table position and contents. The Annualized Price Change row (if enabled) is shown on daily/weekly charts as a descriptive price metric—not a performance claim.
Originality
Original Pine v6 implementation using TradingView built-ins (math.log, math.exp, math.sqrt, math.pow).
Legal Disclaimer
For informational and educational purposes only—not investment, financial, or trading advice. Past results do not guarantee future outcomes; trading involves risk. Provided “as is,” without warranties. Use at your own risk.
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact TradingScriptSolutions directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
Disclaimer
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact TradingScriptSolutions directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.