How to get High/Low/Close of a specified period regarless of chart timescal?

 
I am writing a Pivot Point System. I need to know the High/Low/Close of a specified period.

I need to plot these info from the beginning of the chart so I can study carefully the effect of Pivot Point System on a day to day basis.
 
iHigh(), iLow(), iClose() functions
 
Using iHigh() function, how do I get to know the High for the period covering 5PM EST to 4PM EST (next day?)

Currently I have a loop that first checks for the current hour to compute the shift value needed by iHigh() and work from there.. Is this how you do it?

Or do you guys have a better solution?
 
Using iHigh() function, how do I get to know the High for the period covering 5PM EST to 4PM EST (next day?)

Currently I have a loop that first checks for the current hour to compute the shift value needed by iHigh() and work from there.. Is this how you do it?

Or do you guys have a better solution?


I use this logic:
LookBack = MathCeil((LookBackHours*60+LookBackMinutes)/Period());
Hi = iHigh(NULL, 0, Highest(NULL,0,MODE_HIGH,LookBack,1));
Lo = iLow(NULL, 0, Lowest(NULL,0, MODE_LOW,LookBack,1));
 
I see. So you used the functions Highest() and Lowest().

One problem I encountered with this.

I noticed that the market closes on Friday 4:00PM, And opens Sunday 6:00PM. This implies that there are 118 Hours to a week. 118 is not divisible by 24.

If I were to use Highest(NULL, PERIOD_H1, 24, x), where x is an intereger refering to the number of hours from currtime to 5PM EST, I run the error of gathering data between Friday 2PM EST to Monday 5PM EST or 24 hours... Clearly the logic is erroneous as it should not gather the data from Friday 3PM EST to 5PM EST.

Hmmm...

Is there a way to check the DateTime of a specific Candle?
 
Burgerking,

Truthfully, I never worry about splitting hairs. If my EA won't work because of that, then that EA is not worth the effort. Especially over the weekend, and the gaps, a couple of hours shouldn't make that much of a difference. And even if it did, the EA should be robust enough to handle that. A slight variation of parameters should not nullify an EA's performance.

In any case, why don't you use a day check filter?

For example,
if(TimeDay(CurrTime()) == 1) then LookBack = 22 or something of that sort.

Good luck.