Geek Question

Discussion in 'Trading' started by eyecheck, Apr 1, 2003.

  1. eyecheck


    I have a set of about 600 trade results (P/L) and I am thinking I might be able to model them as statistically uncorrelated for some research I am doing. Anybody know/remember how to check a set of data for statistical correlation?

  2. You should probably start with some sort of chi-squared test. But first you will need to define where you want to look for correlation.
  3. eyecheck


    Thanks, I just basically want to know if the result of one trade is likely to impact the outcome the next couple of trades. I hope the answer is no but I want to verify.

  4. If you have Microsoft Excel, the formula is in the help under the "correl" function.

    I have been doing some work in this area myself. I am coming up with factors for each stock of how closely they correlate to overall market movement. This way, I know that if the market starts moving down and I am long in a stock that correlates pretty closely, I should consider exiting.
  5. acrary


    Break the 600 trades into 2 sets of 300 trades. Then load them into excel. Col. A = first 300 Col. B = second 300.

    Use the correl function to see if there is a correllation between the two sets. =correl(a1:a300,b1:b300)
  6. eyecheck


    Thanks to all;

    Acrary. Will that really test what I want to see if one trade impacts its closest two or three next trades? Seems like that would test correlation between sets a and b.


  7. man


    I think acrary assumes you are breaking up the 600 by numbering them and take the even as one group and the uneven as the second.

    similar thing could be to make a column in which you make a simple if statement. if the current trade has the same prefix as the previous you write 1 if not you write zero. if you find between 295 and 305 zeros (or 1s) you are likely not facing streaks within your equity curve.

  8. Aaron


    Acrary is close, but what you want to do is take the exact same set of 600 trades and copy it to the adjoining column, BUT OFFSET IT BY ONE ROW. Then compute the correlation of the two columns. This will show if there is any correlation between a trade and the trade that follows it. This is called the serial autocorrelation.

    Offset by two rows to check the correlation between a trade and the second trade that follows it, and so on.

    Most technical analysis systems have very little serial autocorrelation -- either in the positive or negative direction. This leads to the conclusion that it doesn't matter whether you wait for a drawdown or a winning streak to begin trading a system -- you can't say anything about whether the next trade will be profitable or not based on the recent past.
  9. eyecheck


    Thanks to all.

    Aaron, I just finished patting myself on the back for figuring out how to do it by shifting rows. I was coming back to post the technique and saw your post.

    I am seeing what you are saying in my data as well. Very small correlation coefficients once I shift.