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

Re: [amibroker] Retrieving yesterday's daily O/H/L/C during RTH in an intraday database?



PureBytes Links

Trading Reference Links



You could adapt something from this script I put up recently:  http://www.amibroker.com/library/detail.php?id=1263

--- On Thu, 9/10/09, rmicalet <rmicalet@xxxxxxxxxxx> wrote:

From: rmicalet <rmicalet@xxxxxxxxxxx>
Subject: [amibroker] Retrieving yesterday's daily O/H/L/C during RTH in an intraday database?
To: amibroker@xxxxxxxxxxxxxxx
Date: Thursday, September 10, 2009, 12:45 AM

 
Does anyone happen to know how to do the following:

I have a one-minute database that shows 24 hours of data. To compute
pivots, I'd like to retrieve yesterday's O/H/L/C, but only from the
regular trading session (9:30 am to 4:00 pm, New York time). If I simply
take the O/H/L/C of the previous day's data I'll get the values
corresponding to the entire 24 hour range of prices. Ideally, I'd like
to isolate the one-minute bars from yesterday at 9:30 am to yesterday at
4:00 pm and then find the max, min, and last price.

I imagine the solution entails something like:

startBar = ValueWhen( timeNum() == 093000 and ???, barIndex());
endBar = ValueWhen( timeNum() == 160000 and ???, barIndex());
yesterday_high = HHV(barIndex( ) >= startBar AND barIndex() <= endBar,
H);
yesterday_low = LLV( barIndex() >= startBar AND barIndex() <= endBar,
L);
yesterday_close = ValueWhen(barIndex( ) == endBar, C);

In the expressions for "startBar" and "endBar", I'm not sure how to
construct the condition that the day in question is yesterday when
dealing with a one-minute database. I tried:

timeFrameSet( inDaily);
yesterday = Ref(Day(),-1) ;
timeFrameRestore( );

startBar = ValueWhen ( timeNum() == 093000 AND Day() == yesterday,
BarIndex());
endBar = ValueWhen ( timeNum() == 160000 AND Day() == yesterday,
BarIndex());

But that doesn't seem to work as no indicators show up when I plot them
out.

I suspect I'm making this a lot harder than it is. Would be grateful for
any insight.

Regards,
Ray Micaletti



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___