Try this, it allows for the bar to be >= the required time, or if the
first bar of the day is >= required time

tn = TimeNum();
dn = datenum();
tns = 93000;

Start = tn>=tns and ( ref( tn<tns ,-1) or dn!=ref(dn,-1) );
 rth_open = ValueWhen( Start, Open);


-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com




2008/8/3 hoolee0820 <[EMAIL PROTECTED]>:
> It seems TimeNum() only works correctly in time based charts. In a
> non-time based chart like Range chart, it may or may not return
> desired result. For example,
>
>  rth_open = ValueWhen(TimeNum() == 93000, Open);
>
> this will only return the Open price if you happend to have a bar
> starting at 9:30, this usually is not the case in a non time based
> chart.
>
> It seems also time compress functions only work with internal time
> based array.
>
> If anyone has any differet views, please correct me and help out.
>
>
> --- In [email protected], "Ara Kaloustian" <[EMAIL PROTECTED]> wrote:
>>
>> 1. Create new array that contains only data of interest
>>     Newarray = iif(TimeNum() >=091500 and Timenum() <141500,High,0);
>> 2. Compress the chart
>>     TimeFrame Set(inDaily);
>>     Read High value Yest_High = Ref(High,-1);
>>     etc
>>
>> TimeFrameResore();
>>
>> ----- Original Message -----
>> From: "hoolee0820" <[EMAIL PROTECTED]>
>> To: <[email protected]>
>> Sent: Saturday, August 02, 2008 2:57 PM
>> Subject: [amibroker] Re: How to get RTH high, low and close in a 24
> hr
>> chart?
>>
>>
>> > --- In [email protected], "hoolee0820" <hoolee0820@>
> wrote:
>> >>
>> >> Please help me to find yesterday regular session (as define in
>> > Database
>> >> Setting, ie 9:30 to 14:15) high, low and close prices in a 24
> hour
>> >> chart. I don't seem to be able to figure that one out. What code
>> > would
>> >> you use....
>> >>
>> >
>> > Let me correct myself and see if someone can help me out...
>> >
>> > how do you determine yesterday's RTH high, low, open and close in
> a non-
>> > time based (e.g. Range Bar) chart?
>> >

Reply via email to