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

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



PureBytes Links

Trading Reference Links

Thanks, Tom and reinsley. Much appreciated.

Regards,
Ray Micaletti

--- In amibroker@xxxxxxxxxxxxxxx, Tom Klopfstein <bluueskyy@xxx> wrote:
>
> 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@xxx wrote:
>
>
> From: rmicalet rmicalet@xxx
> 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/

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/