Finding the Highest High and Lowest Low Between Two Times in MQL5
Summary
This code example shows how to retrieve the highest high and lowest low across a specified time interval for the current symbol and chart timeframe. It maps the start and end times to bar indexes, then uses the platform's highest- and lowest-value functions to locate the relevant bars and returns their prices.
These range extrema can serve as inputs to technical analysis, such as measuring a period's trading range or defining levels for other rules. The document contains code but no trading strategy, performance evidence, or explanation of how to use the resulting values. Its practical behavior depends on valid time inputs, available bars, and the platform's indexing conventions; the example does not discuss error handling for missing or reversed ranges.
Key ideas
- The functions return the maximum high and minimum low over a time interval for the current symbol and timeframe.
- Start and end times are converted into bar indexes before the extrema are located.
- The returned prices can support range analysis or other indicator logic.
- The example does not explain handling for invalid times, insufficient history, or reversed intervals.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.