5.0

5.0 | 2 ratings Rate this file 12 Downloads (last 30 days) File Size: 191.11 KB File ID: #13099
image thumbnail

Are You More Skilled than a Monkey at Trading Stocks ?

by Marcelo Perlin

 

23 Nov 2006 (Updated 18 Feb 2008)

Verifies if a particular performance indicator (eg. annualized return) can be just a case of chance.

| Watch this File

File Information
Description

Considering some input arguments, this function performs n simulations with random trades in a price matrix, saving 3 performance indicators (annualized return, annualized standard deviation and annualized sharpe) at each simulation

For example, suppose that you're a trader and have earned 15% of annualized logarithm return over 248 trading days (1 year) where you traded, in average, for long positions only, 5 stocks for each day and for 50 days. This function will check if a monkey with no skill whatsoever can, in average, replicate your return after transaction costs (defined by the user). If such mamel can do it, maybe you should review your approach at trading.

From the academic point of view, this is called as the bootstrap method for assessing performance. The present code is a variant of such.

The use of random seeds for portfolio performance is not new. The first paper to use it, as I recall is Cumby and Modest (1987). More recently, a more formal approach at the method was given in Burns (2006).

For a practical application of the codes published here, please check the papers of Perlin (2007a) and Perlin (2007b).

References:

BURNS, P. J. (2006) "Random Portfolios for Evaluating Trading Strategies". Available at SSRN: http://ssrn.com/abstract=881735

CUMBY, E., MODEST, D. (1987) "Testing for Market Timing Ability: A Framework for Evaluation". Journal of Financial Economics 25, 169-189.

PERLIN, M. S. (2007a) "Evaluation of Pairs Trading Strategy at the Brazilian Financial Market". Available at SSRN: http://ssrn.com/abstract=952242

PERLIN, M. S. (2007b) "M of a Kind: A Multivariate Approach at Pairs Trading" . Available at SSRN: http://ssrn.com/abstract=952782

Required Products Statistics Toolbox
MATLAB release MATLAB 7 (R14)
Other requirements Requires function trades(), available at zip file.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
17 Sep 2007 Florian Bendl

Great piece of code. Definitely a great way to check my trading strategies...Monkey beware!

17 Jul 2011 Ted Teng

Thank you for sharing your monkey with the public!

Please login to add a comment or rating.
Updates
09 Jul 2007

Lots of changes (I was such a newbie when first published this). Added a lot of stuff and corrected a serious bug at the simulations.

05 Nov 2007

Changed the structure of the function, making it more flexible regarding the parameters for each type of trade

26 Dec 2007

Changed structure of the algorithm so that it matches the method at SSRN papers

18 Feb 2008

No more dependency of function price2ret.m

Tag Activity for this File
Tag Applied By Date/Time
finance Marcelo Perlin 22 Oct 2008 08:49:58
modeling Marcelo Perlin 22 Oct 2008 08:49:58
analysis Marcelo Perlin 22 Oct 2008 08:49:58
bootstrap simulation Marcelo Perlin 22 Oct 2008 08:49:58
trading performance Marcelo Perlin 22 Oct 2008 08:49:58
random portfolios Marcelo Perlin 22 Oct 2008 08:49:58

Contact us at files@mathworks.com