Skip to content
All library documents

Using OHLC and Tick Prices to Mark Market Extremes

Article MQL5 code base

Summary

This indicator plots lines at the highest highs and lowest lows within a chosen period. In addition to bar OHLC values, it considers bid and ask prices observed during each bar, with a lookback setting limiting how many bars it processes.

An optional break-of-structure setting suppresses line segments when price exceeds the currently identified high or low, leaving lines around areas interpreted as support and resistance. When the setting is disabled, the lines also show extreme prices and may slope as the market trends. A version update describes an optimization that processes only ticks from the current bar, allowing use on higher timeframes, and removal of unused buffers. The document explains the indicator’s mechanics but provides no performance evidence or guidance for trading the resulting levels.

Key ideas

  • The indicator locates period highs and lows using OHLC data plus bar-level bid and ask prices.
  • A lookback input limits the amount of historical data processed.
  • An optional setting hides line sections when price breaks the currently identified structure.
  • Without that setting, plotted extremes can form sloping lines during trends.
  • The described update optimizes tick processing for higher timeframes, but no trading results are reported.

Tags

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