Backtesting Algorithm for Testing Buy Signals

Discussion in 'Automated Trading' started by ET873, Jun 11, 2009.

  1. ET873

    ET873

    I am developing some buy strategies and I want to test my buy signals on historical data without considering sell signals. Basically, I am looking at the risk / reward (in hindsight) if I had bought at a certain time. Does anyone know of some common or standard algorithms for backtesting buy signals on historical data? I imagine that I would basically pass the algorithm an array of price data and it would return an array indicating the risk / reward, indicated as a floating point number, for buying at every point.
     
  2. I suggest you do some reading before you start developing strategies and good luck to you. Here are a couple of articles on backtesting:

    http://www.investopedia.com/articles/trading/05/030205.asp

    http://www.tradingpatterns.com/About_Us/articles/introbacktesting.pdf

    Note that as the authors try to explain you should not rely on backtesting. Something that worked in the past may not work in the future and you may end up losing money.
     
  3. ET873

    ET873

    Thanks, I realize that I cannot rely on back testing alone to validate a strategy and I plan to paper-trade a strategy before trading it with real money. I just like the systematic / rigid properties that come with a fully automated system.

    Back to my original question. Does anyone know of an algorithm for judging buy signals? Something that looks ahead at the stock price, observes what happens and then assigns a numerical value to the quality of the buy signal. For example, if I get a buy signal and then the stock price falls through the floor the next day, that would be a very bad buy signal -- high risk, no reward. If I get a buy signal and then the stock price stays fixed for a long time, that would be a bad signal, low risk, low reward. The sorento / sharpe ratio come to mind, but those require a fixed sell point and I don't want to deal with fixed sell points. I basically just want to look into the future and judge numerically how good of a decision it would have been to buy that equity at that time.