Market Timing List?
Author: richshark
Creation Date: 1/6/2012 9:38 AM
profile picture

richshark

#1
Is it possible to utilize a custom market "Up" or "Down" list to create the overall climate for going long or short (for backtesting purposes)? So that a Long strategy would be employed when the market timing list signaled an "Up" condition (e.g.; 3/10/09)?
profile picture

Eugene

#2
First we need to agree on definitions. What's a "list"? For me, List<> is a .NET collection; but for you, that might be a list of candidate stocks emailed in the morning.
profile picture

richshark

#3
To me, a customized market timing list is based upon a set of rules, of my creation, by which I am making a call as to when the market is Bullish, and I want to be long, or when the market is Bearish, and I want to be short (or in cash). I would then create a list of dates representing the beginning of those market phases. For example:

11/4/2009 Bullish /on this date, the market has turned Bullish
1/21/2010 Bearish /on this date, the market has turned Bearish
2/11/2010 Bullish
4/27/2010 Bearish
6/11/2010 Bullish
6/22/2010 Bearish

I would then ask the program to "buy" on the Bullish dates (e.g.; 11/4/2009), and "sell" (or go short) on the Bearish dates (e.g.; 1/21/2010). Or I could then use indicator-based triggers in order to determine specifically when to enter a position now that I have determined that the overall market is favorable to that strategy.

Thanks for your earlier response!
profile picture

Eugene

#4
Thank you for your explanation. The concept makes sense and of course it's possible.

Probably I wasn't clear enough but question still remains: in which form does the list exist for backtesting purposes? If we attempted to code it, is that list in a text file? Let's assume it is. At any rate, with a very little change you can start backtesting the concept right now using this method from Community.Components:

FillSeriesFromFile

With the help of Notepad's Replace function, turn your "Bullish" and "Bearish" values to something formal like 1.0 and -1.0 (respectively) or whatever, and Wealth-Lab will be able to parse the list. There you'll have what's called a "binary wave" DataSeries with your signals coded as numbers - available for instant use in your Strategies.
profile picture

richshark

#5
Eugene,
Although I was hoping for a non-programming solution, this is REALLY great! Your assumption is accurate in that the file can take any form, as it will be user created, and .txt will work fine. The code that you directed me to is comprehensible to me, as I have some programming background (although I need to improve my skills using arrays and parsing the dates). But it'll work just fine.
I have had it drilled into me to not go long if the "market" is not bullish (to me "market" is the S&P 500). So I've been looking for a method of not triggering long buys unless the "market" is in an uptrend. The best way of defining an uptrend is to devise a method (mine is a composite of several, diverse sources) which signals the turning points. Then wealth-lab can perform the back-testing of my "wealth-lab" created, buy/sell strategy within the overall market-timed scope.
I am really looking forward to implementing your recommendation.
I'm now a believer that IS IT POSSIBLE > YES!
Thanks much!!!
PS-I hope that you're also getting some sleep (your last reply was @ 1:28 AM!)
profile picture

Eugene

#6
Rich,

Glad to have helped.

Re: 1:28 AM. MS123 LLC who runs this site is not U.S. based ;)
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).