I need to be able to determine the open/close of the 5min on a 1hour timeframe

 
I want to be able to determine the open/close information for a 5min chart while I am in a 1hour chart. I have the code to access the prices for the 5min while within a 1hour but I need to be able to know the price when the 5min opened/closed not just the price at any given time. Can anyone help me here?

My code to retrieve the price is :-


double array_price[][6];
double array_price1[][6];
double array_price2[][6];

ArrayCopyRates(array_price,Symbol(),PERIOD_M5);
ArrayCopyRates(array_price1,Symbol(), PERIOD_M5);
ArrayCopyRates(array_price2,Symbol(), PERIOD_M5);

double EURUSD_LOW, EURUSD_HIGH,EURUSD_CLOSE;

Thanks
 
The first element in the array is the time...
What is the problem?
.
int ArrayCopyRates( double&dest_array[], string symbol=NULL, int timeframe=0)
Copies rates to the two-dimensional array from chart RateInfo array and returns copied bars amount, or -1 if failed. First dimension of RateInfo array contains bars amount, second dimension has 6 elements:
0 - time,
1 - open,
2 - low,
3 - high,
4 - close,
5 - volume.
Reason: