How to find the Bar Shift Of a Historical Bar

 

Hi,

I know this question must be already asked earlier but i am not really able to find the proper code for the same.

I need the close price for a specific time in history. I do understand that i can get it via iClose[] function. All i need is the working code for getting bars since that time in history.

example. I need the close price for yesterday at 2pm server time for a 5 minute candle. this value will change every day.

any help is much appreciated.

 
Mohit Marwaha:

Hi,

I know this question must be already asked earlier but i am not really able to find the proper code for the same.

I need the close price for a specific time in history. I do understand that i can get it via iClose[] function. All i need is the working code for getting bars since that time in history.

example. I need the close price for yesterday at 2pm server time for a 5 minute candle. this value will change every day.

any help is much appreciated.


iBarShift

 
  1. Mohamad Zulhairi Baba:

    iBarShift

    There is no such iBarShift in MT5. This is Root / MT5 General section not the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. Mohit Marwaha: I need the close price for yesterday at 2pm server time for a 5 minute candle.
 
whroeder1:
  1. There is no such iBarShift in MT5. This is Root / MT5 General section not the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum

The OP is talking about iClose[], we can suppose it's iClose() and it's mql4. So moved.

By the way, there is an iBarshift in MT5 ;-)

 
Alain Verleyen: By the way, there is an iBarshift in MT5 ;-)

#1 was referencing Mohamad Zulhairi Baba's post, not OP. That isn't a MT5 iBarShift, that is custom code and the text explicitly states:

But this function is not included in MQL5

Same as the code reference in the article linked #18.

IBarShift is not found in
        List of MQL5 Functions - Reference on algorithmic/automated trading language for MetaTrader 5

#2 was answering OP.
 
whroeder1:

#1 was referencing Mohamad Zulhairi Baba's post, not OP. That isn't a MT5 iBarShift, that is custom code and the text explicitly states:

Same as the code reference in the article linked #18.

IBarShift is not found in
        List of MQL5 Functions - Reference on algorithmic/automated trading language for MetaTrader 5

#2 was answering OP.

MQL5 is meant to be used with libraries. There are like 5 different iBarShift libs, take your pick.

 
whroeder1:

#1 was referencing Mohamad Zulhairi Baba's post, not OP. That isn't a MT5 iBarShift, that is custom code and the text explicitly states:

Same as the code reference in the article linked #18.

IBarShift is not found in
        List of MQL5 Functions - Reference on algorithmic/automated trading language for MetaTrader 5

#2 was answering OP.

Always a pleasure to discuss with you. The OP post is about mql4 !

nicholishen is perfectly right on this. mql5 (and mql4 by the way) is not a close and static language. 

Anyway that doesn't matter.

Reason: