StrategyQuant
Q AI AssistantAlgoCloudQuantAnalyzerQuantDataManager
Free CourseCompany
BlogDocumentationForumContact us
BlogMarketplace
Log in
Create free account

Product

  • Pricing & licenses
  • Learn
  • Marketplace
  • Start free trial

Legal

  • Terms of Service
  • Privacy Policy
  • Cookies

Contact

[email protected]

Company

StrategyQuant s.r.o.

Korunní 2569/108, Vinohrady, 101 00 Praha 10, Czech Republic, EU

IČ: 04000498

DIČ: CZ04000498

Social

  • Legal Notice | PROCESSING AND PROTECTION OF PERSONAL DATA

    Past performance is no guarantee of future success. All information should be viewed as educational only

    UNITED STATES Disclaimer required by Government - Commodity Futures Trading Commission informs: Futures and options trading have great potential rewards, but also great potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This is neither a solicitation nor an offer to buy/sell futures, shares or options on the same. No representation is being made that any account will or is likely to realise profits or losses similar to those discussed in this document. The past performance of any trading system or methodology is not necessarily indicative of future results.

    CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE A RECORD OF ACTUAL PERFORMANCE, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES WERE NOT EXECUTED, THE RESULTS MAY HAVE OFFSET THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMMES IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO REALISE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN.

    NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL, OR IS LIKELY TO, REALISE PROFITS OR LOSSES SIMILAR TO THOSE DISCUSSED WITHIN THIS SITE. IF YOU DECIDE TO INVEST REAL MONEY, ALL TRADING DECISIONS IN THE FINANCIAL MARKETS SHOULD BE YOUR OWN.

    © StrategyQuant 2026

    Powered by Klaudie.ai

    Back to marketplaceDIGITAL

    (DTW) Dynamic Time Warping

    StrategyQuantIndicators
    (DTW) Dynamic Time Warping

    Measures similarity between price sequences using flexible alignment to identify repeating patterns stretched or shifted in time. Useful for recognizing recurring market structures and pattern-based trading signals.

    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.

    How it works:

    • 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.

    Parameters:

    • 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 Custom Blocks. 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:

    • StrategyQuant Documentation: Custom Blocks
    • StrategyQuant Documentation: Strategy Templates & Custom Blocks
    • StrategyQuant YouTube Tutorial: Custom Blocks Overview

    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

    You know me as clonex. I’m Ivan Hudec — I built the free blocks you’re using here, and I write about the research behind them at algotrading.space. Need something built? Work with me.
    Past performance is no guarantee of future success. All information should be viewed as educational only UNITED STATES Disclaimer required by Government - Commodity Futures Trading Commission informs: Futures and options trading have great potential rewards, but also great potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This is neither a solicitation nor an offer to buy/sell futures, shares or options on the same. No representation is being made that any account will or is likely to realise profits or losses similar to those discussed in this document. The past performance of any trading system or methodology is not necessarily indicative of future results. CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE A RECORD OF ACTUAL PERFORMANCE, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES WERE NOT EXECUTED, THE RESULTS MAY HAVE OFFSET THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMMES IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO REALISE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL, OR IS LIKELY TO, REALISE PROFITS OR LOSSES SIMILAR TO THOSE DISCUSSED WITHIN THIS SITE. IF YOU DECIDE TO INVEST REAL MONEY, ALL TRADING DECISIONS IN THE FINANCIAL MARKETS SHOULD BE YOUR OWN.
    Free

    Files

    • Snippet-DTWDynamicTimeWarping.sqm16 KBLocked

    Download unlocks after purchase or with an active tier.

    Details
    Version1.0.0
    PublishedOctober 19, 2026
    Last updatedNovember 2, 2026
    AppSQ
    TypeSnippet
    Authorclonex / Ivan Hudec
    App version145.3058
    Codebase categoryIndicators / Signals