## Wednesday, April 17, 2013

### Does your trading have an edge? Here's how to find out.

How do you know if your trading system has an edge or whether it's just random luck?

One way I learned was from Adam Grimes' book, "The Art and Science of Technical Analysis."  As I mentioned in the prior post, I consider his book a must have for traders.

In Chapter 12, there's a section called "Statistical Analysis of Trading Results" which discusses "deriving the p value, which is a significant test (one-tailed t-test) for the mean P&L being > 0."  The table on page 389 Adam used as an example looked similar to this (but without the t-value column):
The chapter didn't go into the calculation details, but with some helpful guidance that Adam emailed me, I was able to dust off  the cobwebs and think back to my college statistics class.  You can find out more about p value from here and here.

HOW DO YOU CALCULATE IT?

The steps are simple from within Excel.  Take each individual trade P&L and figure out: 1) the average P&L per trade, 2) the number of trades, and 3) the standard deviation.  If you use Tradervue, Greg will be rolling out the p value soon (if not already) within the reports section.

Then plug in the #'s above into a Excel spreadsheet with the formulas below.  This then calculates the t-value so that the p value can be derived.  It can all be in one formula, but I broke it apart to make it easier to read.
WHAT DOES IT MEAN?

A lower p value is better.  The lower the p value simply means that based on the series of trades analyzed, the results are less likely due to random chance or luck.  In general usage, a p value of < 0.05 is often considered to be statistically significant.

If you have a higher p value, that means your trading results, even if very profitable, could be likely due to random chance or luck vs. having some sort of edge.

For example, if your p value is 0.01, that means based on the data set analyzed, there's a 1% chance of seeing the analyzed results due to random chance or luck.  If your p value is 0.50, then there's a 50% chance your results are based on luck (i.e. not much of an edge).

CAVEATS

Like any calculation used to measure trading or investment performance, whether it's a straightforward % gain on portfolio, win/loss %, profit factor, average profit per trade, or more sophisticated calculations such as Sharpe, Sortino or Sterling ratios, there are pros and cons for each type of measure.

And if your risk based on account size varies per trade, analyzing the trading results based on an R-Multiple or %R should also be highly considered.  Adam Grimes discusses on page 392 that "standardizing for risk removes the position sizing effect" so that it could reveal that a system or trader via the p value could be "trading with a clear statistical edge, even though it was completely obscured by his position sizing decisions."

The p value has its fair share of criticisms, so it's just a reminder that one measure shouldn't be the ultimate judge.  It's best to look at trading results from multiple perspectives and take a holistic approach.  And of course, always use some common sense.

moon graber said...

t-tests are based on a number of assumptions:
http://www.csic.cornell.edu/Elrod/t-test/t-test-assumptions.html

one is that the data are normally distributed, maybe log returns are close to normal...maybe the Mann Whitney test would be a better test
https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test

Atwood said...

Saar Pilosof
Nice blog. Calculation used to measure trading or investment performance is never easy. In this blog you explained very well about the calculation.

alitergalen said...

The Trading Strategies are a list of basic trading terminology to introduce you to different instruments, tools and strategies for different markets.