How to get Price based on just time?

 

What is the easiest way to get Low and High price of a bar at a certain time?
What is known is the time and time period. I want to be able to find the low and high of the bar at that price.

I spent several hours trying to figure it out but don't know how to. Please help.

Thanks
ForexWatchman

 

Because no tick data are accessible you have to go back to the M1 Chart and figure out when the bar at your timeframe has opened. Actually this is a little difficult becouse there sometimes is a lack of data in the M1 Bars so it is not as easy as saying I'm going back an x amount of M1 Bars.

Here's an Example:

You are on a 15 Minute chart and your candle is going to close in 1 second. You want to know what the high was of the bar 5 bars ago after 5 minutes. You would easily calculate:

5*15 to get to the beginning of the 15minute bar you want to watch and
5*15-5 to get to the point you want to know the high of.

So to find the highest and the lowest over this period you do the following

HighValue=iHighest(NULL,PERIOD_M1,MODE_HIGH,5,15*5-5);
LowValue=iLowest(NULL,PERIOD_M1,MODE_LOW,5,15*5-5);
The problems occur if you cover a longer period of time...you then might get shifted values of high and low because of lacks in M1 data. Solving this problem proves a little more tricky and requires someone with some more expirience than I have...

I wish good luck finding one.
 
ErrorProgrammer wrote >>

Because no tick data are accessible you have to go back to the M1 Chart and figure out when the bar at your timeframe has opened. Actually this is a little difficult becouse there sometimes is a lack of data in the M1 Bars so it is not as easy as saying I'm going back an x amount of M1 Bars.

Here's an Example:

You are on a 15 Minute chart and your candle is going to close in 1 second. You want to know what the high was of the bar 5 bars ago after 5 minutes. You would easily calculate:

5*15 to get to the beginning of the 15minute bar you want to watch and
5*15-5 to get to the point you want to know the high of.

So to find the highest and the lowest over this period you do the following

The problems occur if you cover a longer period of time...you then might get shifted values of high and low because of lacks in M1 data. Solving this problem proves a little more tricky and requires someone with some more expirience than I have...

I wish good luck finding one.


Thanks for your reply. Let me make the problem simpler.

How would you find what was the low and high of a 5 minute candle for datetime "2010.3.17 9:00". And how would you do it for a H1 candle at the same time?

 
ForexWatchman:


How would you find what was the low and high of a 5 minute candle for datetime "2010.3.17 9:00". And how would you do it for a H1 candle at the same time?


iBarShift + iHigh