Holiday exclusion
Author: Gamba
Creation Date: 12/13/2012 2:24 PM
profile picture

Gamba

#1
Hi,

I've searched for a script in Forum and Wiki to avoid trading on holidays?
But there are only several old scripts to do it. Did I miss something or is there a Code-Snippet
in Community-Compoments to exclude trading on holidays back to 10 or 20 years?

Regards,
Holger
profile picture

Eugene

#2
Hi,

First let's define what is a holiday. For example, U.S. markets are closed on Independence day. See what I mean?
profile picture

Gamba

#3
For example, for my intraday strategie, I will not trade on the following days, because of early market closing
or holidays (e.g. Thanksgiving) where people are on vacation or something else:

// -----
// 2012
// -----
_20120101, // New Year's Day
_20120116, // Martin Luther King Jr. Day (3rd Monday of January)
_20120220, // Presidents' Day (3rd Monday of February)
_20120406, // Good Friday (Easter-Friday)
_20120528, // Memorial Day (Last Monday of May)
_20120704, // Independence Day
_20120903, // Labor Day (1st Monday of September)
_20121008, // Columbus Day (2nd Monday of October)
_20121111, // Veterans Day
_20121122, // Thanksgiving (4th Thursday of November)
_20121123, // Day after Thanksgiving (4th Friday of November)
_20121224, // Christmas Day

At the moment I manage the holidays by myself in a script (not for WL, but for another software).
In case of WL I want to know if there something generic in the Community.Components or somewhere else.

How does others handle this topic?

Holger
profile picture

Eugene

#4
I see. Simply use the Market Manager as explained in the KB article.
profile picture

Cone

#5
Even without the Market Manager...

CODE:
Please log in to see this code.
profile picture

Gamba

#6
Thank you Cone, that works for me. Did not find the routines by myself before.

@Eugene: MarketManeger does not support Yahoo and for Google my WL-Instance crashes every
time I activate the MarketManager. But solution in code is a better approach for me.
profile picture

Eugene

#7
That's incorrect: the Market Manager have always supported Google.

As to the crash, please feel free to create a support ticket with the complete error message and a screenshot.
profile picture

Gamba

#8
Hm, I don't agree with you, but maybe I'm wrong. First, it crashes with Google, without error,
but that is not important at the moment.

I cannot see Yahoo as data provider in MarketManager, so I cannot active it.
So the number of trades are equal in every case and I guessed it doesn't work with Yahoo:

profile picture

Eugene

#9
Sorry for the confusion, Yahoo! is not supported by the Market Manager since it's an EOD-only data provider (makes no big sense).

Google should not crash after applying the latest update using the Extension Manager. It's recommended to upgrade the provider to version 2012.12.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).