HomeReady-2-GoPortfolioRankingScreenerStockETFToolsCommunityHelp
ForumsEmail UserPollsFeature RequestsGroups


  Index  | Recent Threads  | Who's Online  | User List  | Search
  Search  
Quick Go »
Thread Status: Normal
Total posts in this thread: 11
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[Request a Feature] [Post new Thread]
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 1379 times and has 10 replies Next Thread
garryp
Advanced Member
Member's Avatar

UNITED STATES
Joined: Feb 15, 2008
Posts: 104
Status: Offline
Out-of-sample question Reply to this Post
Reply with Quote

I tend to develop and test a sim/port over the complete range of my available 5 year range of data. But I am slowly coming to realize that I may be curve-fitting by doing this, and I have no remaining out-of-sample data to help uncover if I am.

Is it better to develop using up/dn market sequence(s) in the past, then verify by test over more recent out-of-sample data periods?

This alone might justify the cost of gold membership to get the additional 2 years of data.

--Garry P.
----------------------------------------
-- Garry P.
[May 14, 2008 1:49:42 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
DennyHalwes
Advanced Member
Member's Avatar

UNITED STATES
Joined: Apr 28, 2004
Posts: 1532
Status: Offline
smile   Re: Out-of-sample question Reply to this Post
Reply with Quote

Gary,

See my reply to your other question here.

One of the advantages of the other 2 years of data is that it was a bear market. The last 5 years has been a good Bull market with a few corrections. Using all the data enables you to test over a bear market and a bull market.

Denny cool
----------------------------------------
"The significant problems we face cannot be solved at the same level of thinking that we were at when we created them". Albert Einstein
[May 14, 2008 3:40:15 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
dwpeters
Advanced Member


UNITED STATES
Joined: Feb 10, 2007
Posts: 659
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

Hi,
This is an important question and one I strongly suggest you answer before putting real money behind a port. There are a number of discussions along these lines. Here is one. I particularly suggest you checkout Olikea's post in that thread where he shows how some very strong sims fell apart out of sample.

Although there is certainly value in testing systems on data from 7 years ago, my opinion is there is more value in out of sample testing on recent data. My perspective is as noted by Mark Twain: "History, rhymes; it does not repeat." The markets changed significantly over the last year. Small Cap Value outperformed from 2001 into 2007 and is now clearly underperforming, at least vs. Large Cap Growth. So what worked best in 2001-2002 (small cap value) is very unlikely to work best now.

I have found that good ranking systems tend to be fairly robust and that sims with very many trading rules are not - I did a number of tests comparing minimal buy/sell rules to my favorite buy/sell rules - minimal rules clearly did better out of sample. I have a combination of ports based on some public ranking systems and a couple private ones, all with minimal buy and sell rules. I am tracking the performance through 20 stock ports, trading much smaller versions, and allocating more to the methods that are outperforming in the current environment and less to those that are not. I won't be setting any records for performance on this site (way too much good competition) but I've found the hard way that higher performance often comes with higher volatility - even if this was not seen in backtesting.

Don
[May 14, 2008 11:11:08 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
danparquette
Advanced Member


UNITED STATES
Joined: Jul 27, 2004
Posts: 381
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

I was trying to figure out a buy rule which could be used to create 2 universes out of the existing universe of stocks with each universe having approximately the number of stocks. Then you could optimize the sims with the buy rule in place which would limit the universe to 50% of the total available universe. Once you have optimized it, you could switch the buy rule so that the sim uses the other 50% of the total universe - that would give you your out of sample test.

But the catch is that the factor used to split the universe has to be something that should have no effect on returns. For example, you could not use a rule like Price > 30 to define one universe and Price < 30 for the other since that would affect returns.

I was going to do something simple like CompanyName < "m", but there is no factor for CompanyName. I also thought that maybe a buy rule could be if price was even then its in set 1 and those where price was odd would be the out of sample group - but there is no remainder function in the math functions. Anybody have an idea how to do this?
----------------------------------------
Dan
[May 15, 2008 8:55:50 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
Stittsville123
Advanced Member


CANADA
Joined: Nov 20, 2004
Posts: 1306
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

Wasn't there a thread on using the Random function for this sort of thing?

Steve
[May 15, 2008 9:02:36 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
marco


UNITED STATES
Joined: Jan 1, 1970
Posts: 3981
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

Dan, I like this idea. We need two new functions:

StockId
Trunc(number)

StockId returns our internal integer id for a company
Trunc() returns the integer portion of a number.

You could then write something like

Trunc(StockId/2) = StockId/2

This will return all stocks with even id

Trunc(StockId/2) != StockId/2

This will return all stocks with odd id

Should be pretty close to 50/50
----------------------------------------
Portfolio123 Staff
[May 15, 2008 9:10:56 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
danparquette
Advanced Member


UNITED STATES
Joined: Jul 27, 2004
Posts: 381
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

Marco,
That sounds like a good solution and it would give us 2 universes. How about a function like Right(text, Num_chars) to retrieve the right most digit? The database probably has this function available already.

This would make it more flexible. For example:
Buy rule for Universe 1:
Right(StockId,1)=0 OR Right(StockId,1)=2 OR Right(StockId,1)=4 OR Right(StockId,1)=6 OR Right(StockId,1)=8

Universe 2:
Right(StockId,1)=1 OR Right(StockId,1)=3 OR Right(StockId,1)=5 OR Right(StockId,1)=7 OR Right(StockId,1)=9

Then we could vary the contents of the 2 universes.

Thanks.
----------------------------------------
Dan
[May 15, 2008 1:08:23 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
marco


UNITED STATES
Joined: Jan 1, 1970
Posts: 3981
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

We'll add this as well

Mod(val,modulo): modulus operation that returns the remainder of val/modulo (parameters are converted to integers)

To define three random universes you could do this:

Between( Mod (StockID,20), 0,6)
Between( Mod (StockID,20),7 ,13)
Between( Mod (StockID,20),14 ,19)
----------------------------------------
Portfolio123 Staff
[May 15, 2008 2:48:38 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
marco


UNITED STATES
Joined: Jan 1, 1970
Posts: 3981
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

That example was overly complex. This way you'll be able to define three random universes:

Mod (StockID,3) = 0
Mod (StockID,3) = 1
Mod (StockID,3) = 2
----------------------------------------
Portfolio123 Staff
[May 15, 2008 3:24:22 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
crakes
Advanced Member


UNITED STATES
Joined: Oct 31, 2006
Posts: 229
Status: Offline

Re: Out-of-sample question Reply to this Post
Reply with Quote

Wow. Great idea Dan, and very elegant solution Marco. I can't wait to hear how this new mode of in-sample testing proves out!
[May 16, 2008 7:06:32 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[Show Thread Printable Version] [Post new Thread]

Free Trial  /  Log In
Username or Email
Password
Stay logged in
Can't remember username or password?