Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off topic by SRKX, chrisaycock Nov 12 '11 at 21:29

Questions on Quantitative Finance Stack Exchange are expected to relate to quantitative finance within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

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. – SRKX Nov 12 '11 at 20:51
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. – chrisaycock Nov 12 '11 at 21:30
up vote 3 down vote accepted

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.

share|improve this answer

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