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.
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với TradingScriptSolutions.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với TradingScriptSolutions.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.