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

Re: [amibroker] Checking last bar for current date



PureBytes Links

Trading Reference Links

Some ideas:

1. How about just comparing barcount() to the barcount() of a foreign index
you know is trading, such as $COMPQ. If they're not the same, then you don't
have data for the current day.

2. You could simply test to make sure you're not on a weekend with:

WE = IIf( DayOfWeek() == 6 OR DayOfWeek() == 0,True,False);

3. However, this doesn't catch Holidays. You can try modifying this code
which finds the last day of the week, even if it's not a Friday.

/*Find last trading day of the week (EOW = end of week)*/

EOW = IIf(((DayOfWeek()<5 AND DayOfWeek()>2 AND Ref( DayOfWeek(), 1 ) < 2)
  OR DayOfWeek() == 5),True,False);

/*The above code looks 2 days into the future, but only to determine last
day of the week*/

That still doesn't catch other Holidays.

-- 
Terry

> From: kaveman perth <kavemanperth@xxxxxxxxx>
> Reply-To: amibroker@xxxxxxxxxxxxxxx
> Date: Tue, 7 Dec 2004 15:42:48 +0800
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Checking last bar for current date
> 
> 
> Using unpadded data (ie no zero volume days shown) how can I build in
> to explorations to exclude the stock if the last bar is not the last
> actual traded day. I do not want to bring up a result for a stock that
> did not trade on the last market open day.
> I know I can use Now() but if I do exploration over the weeken or on
> public holidays then the exploration won't work at all. I ahd thought
> of checking using the foreign function against an index but from what
> I read in help only OHLCVI are allowable data fields, not datenum().
> Can anyone provide some help on this
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/