• Overview
  • Reviews
  • Comments
  • What's new

HoughTransform

This indicator automatically builds an alternative set of resistance and support lines based on areas where price are concentrated (instead of extremum points). The algorithm utilizes Linear Hough Transform (Wikipedia).

New lines are used for trading in the similar way as in the classical approach, that is they indicate points for possible reversal or breakthrough in the future price actions. Yet their main advantage is that they cover most populated and consistent price regions, discovering a kind of a "center of mass" and "attractors", which seem to be more stable and fundamental features than dispersed extrema.

The indicator shows up to 8 most prominent (in the sense that the transform formula implies) straight lines. The thicker the line, the better its representation in the polar coordinates space, which means that it finds a stronger confirmation in the price chart.

The indicator is calculated bar by bar, ticks are not processed.

Parameters

  • PictureSize - number of bars used for the analysis; the same quantity of cells is reserved for price quantization in the range between maximum and minimum price on the given number of bars; default value is 100;
  • Offset - an offset in bars for the analysis on the history; default value is 1, which means on-line analysis; as the indicator is calculated at bar opening, it makes no sense to set Offset equal to 0, because the new bar does usually have equal Open, Close, High and Low prices and does not affect the analysis;
  • HoughSize - the size of the polar coordinates space used for the analysis; default value is 20; the larger the value, the more precise is the calculation of lines, but it will require more resources; recommended values are from 10 to 50;
  • Price - one of two modes of price capture on every bar: Low/High (by default) or Close/Close; the first one means the bar is detected from its High to Low, the second - from Open (Close of the previous bar) to Close;
  • Color - color of the lines, blue by default;

The sceenshots below demonstrate the indicator with different PictureSize values and on the history at specified Offset.

No reviews
Version 1.2 - 2015.10.26
Extended the price application mode list (Price parameter): LowLow draws lines through new bar minimums (bar Low is lower than the previous Low) and HighHigh draws lines through new bar maximums (bar High is higher than the previous High). New parameter ExtremumRanking is added ('false' by default) to enable a special mode, when "power" of new highs and lows is taken into account as a number of previous successive bars in the same direction (used only for LowLow and HighHigh prices).
Version 1.1 - 2015.04.24
Fixed a minor issue with missing cleanup of old bars when a chart with the indicator is restored after terminal start.