Skip to content
All library documents

Using a Theil–Sen Slope Indicator to Estimate Market Direction

Article MQL5 code base

Summary

The indicator estimates the direction of a price or derived series by fitting a regression line to a selected set of observations and measuring its slope. Inputs can include closing, high, or low prices, as well as moving averages, and the tool is described as supporting multiple currency pairs. A sample expert advisor call uses a selected timeframe, regression period, data series, and bar shift, with optional chart text about market phase and tendency.

The document illustrates how the plotted line may appear in ranging and trending markets, but supplies no quantified examples, validation, or trading performance results. It is an indicator description rather than a fully specified entry and exit strategy. The choice of input series and regression window can affect the estimate, and the material does not explain how to manage signals, transaction costs, or risk. The accompanying breakpoint tool is optional to the indicator.

Key ideas

  • The indicator estimates trend direction by calculating the slope of a regression line fitted to selected observations.
  • Inputs may be closing prices, high or low prices, or moving averages.
  • The regression period and chart timeframe are configurable.
  • The example displays market phase and tendency information, but does not define a complete trading system.
  • The document provides no backtest or performance evidence.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.