Curvature Trend

Category: Indicators By: Marc Boliart Created: April 1, 2025, 11:17 AM
April 1, 2025, 11:17 AM
Indicators
2 Comments

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.

// 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"

Download
Filename: Curvature-Trend.itf
Downloads: 88
Marc Boliart New
Scalp trader since 2006
Author’s Profile

Comments

Logo Logo
Loading...