28. 3. 2025

5 0

(DTW) Dynamic Time Warping

The Dynamic Time Warping (DTW) indicator measures the similarity between two sequences of price data by aligning them in a way that minimizes their distance. It’s useful for identifying repeating patterns or aligning similar patterns even if they are stretched or shifted in time.

Cómo funciona:

  • Flexible Pattern Matching:
    DTW allows for non-linear alignment, meaning it can detect patterns that are similar but not perfectly synchronized. This makes it effective for analyzing price data with irregular timing.

  • Distance Calculation:
    The indicator supports multiple distance metrics (absolute and squared differences) to determine how closely the current pattern matches past patterns.

  • Window-Based Analysis:
    It scans a defined window of price data and compares it against a smaller pattern size. This helps identify the most similar historical patterns within the specified range.

Parámetros:

  • WindowSize:
    Sets the range of historical data to search through. Larger windows provide more context but can be slower to compute.

  • PatternSize:
    Determines the length of the pattern you’re trying to match. A smaller pattern size will pick up short-term similarities, while a larger size will focus on broader trends.

  • DistanceType:
    Allows you to choose how differences between points are measured—absolute differences or squared differences. This can affect the sensitivity of the indicator.

Outputs:

  • DTW Value:
    The indicator produces a single value that represents the minimum DTW distance between the current sequence and the most similar historical pattern within the specified window. A lower value indicates a closer match.

What it’s good for:
The DTW indicator is ideal for traders looking to identify recurring price structures or align patterns that don’t perfectly overlap. It provides insight into the similarity of past and current price action, which can help in forecasting potential movements or confirming the presence of repeatable market behaviors.

Indicator Availability:
This indicator is implemented for MT4, MT5, TradeStation, and MultiCharts.

Using Custom Blocks for Conditions:
You can easily define your own conditions in StrategyQuant X using Bloques personalizados. This allows you to set up parameters such as periods or steps to fine-tune the indicator to your strategy. For more detailed information, refer to the following resources:

Importing Custom Indicators into SQX:
To import custom indicators into StrategyQuant X, follow the step-by-step instructions provided here:
Import & Export Custom Indicators and Other Snippets

Suscríbase a
Notificar a
0 Comentarios
Más antiguo
Más reciente Más votados
Feedbacks de Inline
Ver todos los comentarios