Thank you so much Graham, you sure solved the problem of finding the starting bar. But isn't the 9:30 open price still buried somewhere in that bar, or the bar befrore it? I guess only way to do it is switching to time based, like this:
TimeFrameMode(0); the_open = TimeFrameGetPrice( "O", inDaily); TimeFrameRestore(); or: TimeFrameMode(0); timeframeset(300); the_open = ValueWhen(TimeNum() == 93000, O); TimeFrameRestore(); But for the first example, I get different values in different Range bar charts according to the size of the range; For the second example I noly get some "ramdom" values. The time frame functions seem to act unexpectedly. Maybe that is because I have a 1 minute Base Time Interval datebase, instead of Tick base database? Your thoughts please, or suggestions from others are all welcome. BTW, I've been using your PnF codes for my custome charting, thank you! (just wondering how do we find the RTH's O, H, L, and C in that kind of chat too). --- In [email protected], Graham <[EMAIL PROTECTED]> wrote: > > 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" <ara1@> 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" <hoolee0820@> > >> 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? > >> > >
