[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: How to get RTH high, low and close in a 24 hr chart?



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> 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 <hoolee0820@xxx>:
> > 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 amibroker@xxxxxxxxxxxxxxx, "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: <amibroker@xxxxxxxxxxxxxxx>
> >> 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 amibroker@xxxxxxxxxxxxxxx, "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?
> >> >
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/