Avoid holidays? (futures)
Author: fritz
Creation Date: 8/25/2010 6:08 PM
profile picture

fritz

#1
I have a script that looks at a day's range and acts if it's a low-range day. But sometimes those low-range days are holidays -- 5/31/10 for example, when many futures markets were open but volume was very low -- and I end up taking trades I shouldn't. So in this case I would want to avoid trading on 6/1/10, the day after the holiday, and probably on the holiday itself.

Is there a way to know what days are holidays? I searched the forums and there was a Holiday Study (several incarnations) in WL4, but all links to it are dead and I don't see anything available for WL .NET. I'd do it myself but this is a nontrivial problem.

Thanks,
Gary
profile picture

Cone

#2
Whenever you see a dead link to an old version 4 discussion, just replace "www" in the url with "wl4" (WL4).

Which country's holidays are you interested in?
profile picture

fritz

#3
US Futures markets primarily. Others might be of interest eventually but US Futures is what I want for now.
profile picture

Cone

#4
In that case, it's very straightforward -

CODE:
Please log in to see this code.
The holidays come from the ..\Data\Markets.xml file. It's mostly forward-looking and the history is limited, but you could generate holiday dates and fill in what you need.
profile picture

fritz

#5
OK, thanks. That should work.

So is this documented anywhere? How would one find it without bugging you? Even knowing the name of it, I googled the site and searched the help and I didn't find anything about MarketInfo. It's not shown as one of the Bars components in the QuickRef and that's the only docs I can find about Bars.
profile picture

Eugene

#6
MarketInfo is documented in the QuickRef. At least in version 6.
profile picture

fritz

#7
Eugene, I tried that code. It works on stocks but not on futures. I don't see anything in Markets.xml that limits it to stocks. The Name and Description fields imply the holidays apply to stocks, but how does it limit it to stocks? How do I get the holidays to work for futures markets?
profile picture

Eugene

#8
Our unreleased (yet) tool called Market Manager can make this happen...

...but the data provider should explicitly support it.
profile picture

Cone

#9
QUOTE:
How do I get the holidays to work for futures markets?
How about grabbing a stock's Bars object with GetExternalSymbol?
profile picture

DaveAronow

#10
Not ideal, but if you use a stock such as IBM and find a weekday with no data then you can guesstimate it's a holiday.
profile picture

Cone

#11
Dave, fritz is saying that the MarketInfo.Holidays method isn't working for futures. Assuming that is so, if you grab a Bars object from a stock, you can use it to test the date with the MarketInfo.Holidays method. It doesn't matter if the stock has a bar for that day or not. I argue it is nearly ideal. (Ideal would be that it worked for futures too.)
profile picture

fritz

#12
Hrm. Not very pretty but better than nothing. Thanks Cone!
profile picture

DaveAronow

#13
I was saying that since futures (at least equities futures and usually bonds, energy, etc. futures too) trade on similar calendars so if you grab IBM and use the weekdays without prices as implied holidays that's generally good enough even if the date is far back enough you don't have a holiday returned from MarketInfo. That said I remember seeing a few years ago someone had compiled a list of market data events and was selling it. It was for use with tradestation but could be used with any product. I can dig up info (I think) if you can't find it.
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).