Auto Trend Drawing [LuxAlgo]The Auto Trend Drawing indicator summarizes price action into a smooth, continuous curve that highlights the primary market direction and structure.
It is mostly a fun and silly experiment in reproducing users attempts at drawing trends on the chart using the brush tool.
This indicator is subject to repainting and is displayed retrospectively based on the most recent price data.
🔶 USAGE
The Auto Trend Drawing tool provides a clean, visual representation of the current market "flow" by stripping away minor price noise and focusing on significant pivot points. Traders can use this indicator to quickly identify the prevailing trend, potential trend reversals, and the overall rhythm of the market.
Unlike standard trendlines that connect two specific points, this indicator creates a dynamic curve that adapts to the most significant price movements within a user-defined window.
🔹 Trend Identification
Bullish Flow: When the curve is sloping upward and the price generally stays above or near the curve's trajectory.
Bearish Flow: When the curve is sloping downward and the price remains below or near the curve's trajectory.
Consolidation: When the curve flattens out, indicating a lack of clear directional momentum.
🔶 DETAILS
The script employs a multi-step process to generate the trend curve:
Normalization: Price data is normalized using the Average True Range (ATR). This ensures that the simplification process remains consistent across different assets and timeframes regardless of their volatility.
Ramer-Douglas-Peucker (RDP) Algorithm: This algorithm identifies the most "important" anchor points in the price series by recursively simplifying the path. It removes points that deviate less than a certain threshold (set by the Simplification Multiplier) from a straight line.
Catmull-Rom Splines: Once the key anchor points are identified, the script uses Catmull-Rom spline interpolation to connect them. This creates a smooth, aesthetic curve that passes through every identified anchor point, providing a more "organic" look than jagged lines.
🔶 SETTINGS
Window Size: Determines the number of recent bars the indicator analyzes to build the curve.
Simplification Multiplier: Controls the sensitivity of the trend detection. Higher values filter out more noise, resulting in a smoother, more "macro" curve. Lower values allow the curve to follow price more closely.
ATR Length: The period used for the ATR normalization process.
Curve Tension: Adjusts how tightly the spline curve follows the anchor points. A value of 0.5 is centripetal, while higher or lower values change the curvature between points.
Curve Resolution: Sets the number of sub-points calculated between each anchor. Higher values result in a smoother-looking line.
Line Color: Changes the color of the trend curve.
Line Width: Adjusts the thickness of the displayed curve.
Pine Script® 인디케이터



















