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.
סקריפט להזמנה בלבד
רק משתמשים שאושרו על ידי המחבר יכולים לגשת לסקריפט הזה. תצטרך לבקש ולקבל אישור להשתמש בו. אישור זה ניתן בדרך כלל לאחר תשלום. לפרטים נוספים, בצע את ההוראות של המחבר למטה או צור קשר ישירות עם TradingScriptSolutions.
TradingView לא ממליצה לשלם עבור סקריפט או להשתמש בו, אלא אם כן אתה סומך לחלוטין על המחבר שלו ומבין איך הוא עובד. ייתכן שתמצא גם אלטרנטיבות חינמיות בקוד פתוח בסקריפטים של הקהילה שלנו.
הוראות המחבר
כתב ויתור
סקריפט להזמנה בלבד
רק משתמשים שאושרו על ידי המחבר יכולים לגשת לסקריפט הזה. תצטרך לבקש ולקבל אישור להשתמש בו. אישור זה ניתן בדרך כלל לאחר תשלום. לפרטים נוספים, בצע את ההוראות של המחבר למטה או צור קשר ישירות עם TradingScriptSolutions.
TradingView לא ממליצה לשלם עבור סקריפט או להשתמש בו, אלא אם כן אתה סומך לחלוטין על המחבר שלו ומבין איך הוא עובד. ייתכן שתמצא גם אלטרנטיבות חינמיות בקוד פתוח בסקריפטים של הקהילה שלנו.