I have a simple stock market trading hypothesis ...

Something along these lines:

Based on a certain deviation from a stock market index over a 30-day period, 5 certain stocks tend to drift in a particular direction during the next 30-day period.

I'd like to run this hypothesis on historical data to see if there's any truth to this.

How do I go about?

  • $\begingroup$ Hi Dan, welcome to QuantSE. I believe your questions belongs to this SE site, as it is actually too basic for this site focused on academic and professionals. In short, use R, MATLAB or Excel and get your data from Yahoo! Finance. $\endgroup$ – SRKX Nov 12 '11 at 20:51
  • $\begingroup$ From the FAQ: The Quantitative Finance Stack Exchange is intended for professionals and academics involved in securities valuations, risk modeling, and other topics related to quant modeling or trading. Basically, if you aren't earning a living at this, it's probably off topic. $\endgroup$ – chrisaycock Nov 12 '11 at 21:30

In terms of technology, I would suggest R.

In terms of specific actions, you need to decide what to do when the trigger event occurs and you need to decide how to close the positions. Given that, you can then determine your profit and loss on the strategy over the data period.

You can use the random portfolio idea by running your strategy a number of times except use 5 randomly selected stocks in place of your specific 5 stocks. You will then get a distribution of profit and loss from the random stocks to compare against the result from your real strategy. If your strategy is not in the upper tail, then don't do your strategy.

But even if your strategy does look good in that test, that doesn't mean it is a real phenomenon. You got your idea from looking at market data. You don't want the test to be based on data that gave you the idea.

And of course even if your strategy passes a truly out-of-sample test, markets can (and do) change.


Not the answer you're looking for? Browse other questions tagged or ask your own question.