Curvature Trend Description
Purpose: Identifies the direction, strength, and potential reversal points of a trend.
Key Features:
- A primary trend band that adapts to market conditions.
- Adjustment based on “curvature” (similar to a radius) that modifies the band’s angle according to volatility and price movement.
- Upper and lower bands acting as dynamic support/resistance levels.
- Adjustable parameters such as initial distance and volatility multiplier.
Since ProRealCode does not have a native “curvature” function like some TradingView indicators, we approximate it using a combination of moving averages, volatility (such as ATR), and dynamic adjustments to replicate the described behavior.
Parameters:
- StartDistance: Initial multiplier to define the band width (equivalent to “Start Points Distance” in Radius Trend).
- StepCurvature: Incremental curvature adjustment to simulate the dynamic angle change (based on volatility).
- ATRPeriod: ATR period to measure market volatility.
- TrendLength: Length of the moving average that serves as the trend base.
Core Components:
Primary Trend (TrendBase):
An EMA (Exponential Moving Average) is used as the central line, similar to how the Radius Trend establishes a dynamic base.
Volatility (Volatility):
ATR (Average True Range) is used to adjust the bands according to volatility, mimicking the adaptability of the original indicator.
Dynamic Bands:
- UpperBand and LowerBand are calculated by adding/subtracting a multiple of volatility to/from the trend base.
- The curvature adjustment is simulated by incrementing or decrementing the bands based on price direction (PriceChange), imitating the adaptive behavior of the Radius Trend.
Output:
Returns three lines: the upper band, the primary trend (curvature), and the lower band, which can be visualized on the chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
// Indicador Curvature Trend adaptado para ProRealCode por @mboliart (https://x.com/mboliart) // Parámetros ajustables StartDistance = 2.0 // Distancia inicial (multiplicador) StepCurvature = 0.1 // Paso de ajuste de la curvatura ATRPeriod = 14 // Período del ATR para medir volatilidad TrendLength = 20 // Longitud de la tendencia base // Calcular la base de la tendencia (media móvil exponencial) TrendBase = ExponentialAverage[TrendLength](Close) // Calcular la volatilidad (ATR) Vola = AverageTrueRange[ATRPeriod] // Ajustar dinámicamente las bandas superior e inferior UpperBand = TrendBase + (StartDistance * Vola) LowerBand = TrendBase - (StartDistance * Vola) // Ajuste de la "curvatura" dinámica basado en la dirección del precio PriceChange = Close - Close[1] IF PriceChange > 0 THEN UpperBand = UpperBand + (StepCurvature * Vola) LowerBand = LowerBand + (StepCurvature * Vola * 0.5) ENDIF IF PriceChange < 0 THEN LowerBand = LowerBand - (StepCurvature * Vola) UpperBand = UpperBand - (StepCurvature * Vola * 0.5) ENDIF // Devolver las bandas RETURN UpperBand coloured(154,205,50,150) AS "Banda Superior", TrendBase AS "Tendencia Principal", LowerBand coloured(255,20,147,150) AS "Banda Inferior" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Thank you so much, for my point of view very useful!!!
YW!