Sunday is working day problem?

View: New views
5 Messages — Rating Filter:   Alert me  

Sunday is working day problem?

by Oleg M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!
During investigation AQ source code I've found, that Sunday can never be a working day because of checking CalendarUtils.isBusinessDay(opening) inside ExchangeCalendar.todaysOpening(...), but in reality it can be. For example, 2009-01-11 was working day in Russia.
Is it possible to fix this case in ExchangeCalendar? The own implementation for IExchangeCalendar for this case only is not convenient, because a lot of calculations are the same.
Or may be I've missed something?

Re: Sunday is working day problem?

by Oleg M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think, this case can be fixed with moving CalendarUtils.isBusinessDay(opening) after holiday check.
Thus such unusual Sundays can be set as partial holidays with regular opening and closing times.

Re: Sunday is working day problem?

by Mike Kroutikov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Oleg,

You may also want to have a look at somewhat different approach to calendar in the sandbox:


As to the fixing the ExchangeCalendar class: please suggest what you think have to be fixed (preferably as a code patch). We will review and commit the change.

Regards,
-Mike

On Sun, Sep 27, 2009 at 12:19 PM, Oleg M. <oleg.malahov@...> wrote:

Hello!
During investigation AQ source code I've found, that Sunday can never be a
working day because of checking CalendarUtils.isBusinessDay(opening) inside
ExchangeCalendar.todaysOpening(...), but in reality it can be. For example,
2009-01-11 was working day in Russia.
Is it possible to fix this case in ExchangeCalendar? The own implementation
for IExchangeCalendar for this case only is not convenient, because a lot of
calculations are the same.
Or may be I've missed something?
--
View this message in context: http://www.nabble.com/Sunday-is-working-day-problem--tp25627027p25627027.html
Sent from the ActiveQuant mailing list archive at Nabble.com.

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi


_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi

Re: Sunday is working day problem?

by Oleg M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, Mike!
Thanks for the link! I will look at it.
Also I've atached a patch, which, I hope, fix the case with Sunday as working day. The patch contains changes for two classes:
1. ExchangeCalendar;
2. ExchangeCalendarTest.

Sunday_can_be_working_day.patch
Mike Kroutikov-2 wrote:
Hi Oleg,
You may also want to have a look at somewhat different approach to calendar
in the sandbox:
http://activequant.org/svn/sandbox/activequant-sandbox/trunk/activequant-util-calendar/

As to the fixing the ExchangeCalendar class: please suggest what you think
have to be fixed (preferably as a code patch). We will review and commit the
change.

Regards,
-Mike

On Sun, Sep 27, 2009 at 12:19 PM, Oleg M. <oleg.malahov@gmail.com> wrote:

>
> Hello!
> During investigation AQ source code I've found, that Sunday can never be a
> working day because of checking CalendarUtils.isBusinessDay(opening) inside
> ExchangeCalendar.todaysOpening(...), but in reality it can be. For example,
> 2009-01-11 was working day in Russia.
> Is it possible to fix this case in ExchangeCalendar? The own implementation
> for IExchangeCalendar for this case only is not convenient, because a lot
> of
> calculations are the same.
> Or may be I've missed something?
> --
> View this message in context:
> http://www.nabble.com/Sunday-is-working-day-problem--tp25627027p25627027.html
> Sent from the ActiveQuant mailing list archive at Nabble.com.
>
> _______________________________________________
> ccapi mailing list
> ccapi@activestocks.de
> http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
>

_______________________________________________
ccapi mailing list
ccapi@activestocks.de
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi

Re: Sunday is working day problem?

by Mike Kroutikov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I committed Oleg's patch to the current trunk. Guys, please review.

Oleg, thanks for the contribution.

-Mike

On Mon, Sep 28, 2009 at 9:54 AM, Oleg M. <oleg.malahov@...> wrote:

Hello, Mike!
Thanks for the link! I will look at it.
Also I've atached a patch, which, I hope, fix the case with Sunday as
working day. The patch contains changes for two classes:
1. ExchangeCalendar;
2. ExchangeCalendarTest.

http://www.nabble.com/file/p25645382/Sunday_can_be_working_day.patch
Sunday_can_be_working_day.patch

Mike Kroutikov-2 wrote:
>
> Hi Oleg,
> You may also want to have a look at somewhat different approach to
> calendar
> in the sandbox:
> http://activequant.org/svn/sandbox/activequant-sandbox/trunk/activequant-util-calendar/
>
> As to the fixing the ExchangeCalendar class: please suggest what you think
> have to be fixed (preferably as a code patch). We will review and commit
> the
> change.
>
> Regards,
> -Mike
>
> On Sun, Sep 27, 2009 at 12:19 PM, Oleg M. <oleg.malahov@...> wrote:
>
>>
>> Hello!
>> During investigation AQ source code I've found, that Sunday can never be
>> a
>> working day because of checking CalendarUtils.isBusinessDay(opening)
>> inside
>> ExchangeCalendar.todaysOpening(...), but in reality it can be. For
>> example,
>> 2009-01-11 was working day in Russia.
>> Is it possible to fix this case in ExchangeCalendar? The own
>> implementation
>> for IExchangeCalendar for this case only is not convenient, because a lot
>> of
>> calculations are the same.
>> Or may be I've missed something?
>> --
>> View this message in context:
>> http://www.nabble.com/Sunday-is-working-day-problem--tp25627027p25627027.html
>> Sent from the ActiveQuant mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> ccapi mailing list
>> ccapi@...
>> http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
>>
>
> _______________________________________________
> ccapi mailing list
> ccapi@...
> http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
>
>

--
View this message in context: http://www.nabble.com/Sunday-is-working-day-problem--tp25627027p25645382.html
Sent from the ActiveQuant mailing list archive at Nabble.com.

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi


_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi