Obtain maxim and minimum price from specific time range.

 

Hello!

I would like to obtain the maximum and the minimum price of an asset from a specific time range, lets say I want to obtain the max and min between 0:00 and 06:30 AM.

How can I retrieve that? Thank you!!

Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Price Constants - Indicator Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
mr_sens: I would like to obtain the maximum and the minimum price of an asset from a specific time range, lets say I want to obtain the max and min between 0:00 and 06:30 AM. How can I retrieve that? Thank you!!

Search the CodeBase for sample code for a Donchian channel. Study the various examples, then apply what your learn to your own requirements.

Also study the documentation for the following functions:

iBarShift

Returns the index of the bar corresponding to the specified time

iHighest

Returns the index of the highest value found on the corresponding chart (shift relative to the current bar)

iLowest

Returns the index of the smallest value found on the corresponding chart (shift relative to the current bar)

Documentation on MQL5: Timeseries and Indicators Access / iBarShift
Documentation on MQL5: Timeseries and Indicators Access / iBarShift
  • www.mql5.com
iBarShift - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Oh yes, iBarShift is what I need.

Thank you Fernando! :)