Backtesting/programming question

Discussion in 'Trading Software' started by polr_trader, Oct 18, 2006.

  1. I have painstakingly backtested a trading strategy--manually!--going back many years with about 100 charts (various stocks, bonds, currencies, and commodities). With its success, I would now like to backtest it thoroughly going back many decades with thousands of securities.

    My question is this: Do the easy-to-use backtesting systems such as Tradestation, AmiBroker, and Wealth-Lab allow complex parameters, or do I need to go with a more sophisticated programming alternative (either from scratch or with a platform that supports C# or whatever)? Examples of the parameters that aren't so universal include: historical volatility of the security (i.e., if the security's volatility exceeds X%, then do not take a position) and direction of the 200-day moving average (i.e., only go long if the 200dma is sloped up).

    Any advice is much appreciated!
  2. I am not intimitely familiar with the products you mention, but I think they should all allow you to implement the restrictions you mentioned without too much trouble. I don't think it will be very complex, but it would require a few lines of programming.

    Is it the programming part where you are getting hung up on? You asked about RightEdge in this post. You will be able to create these types of systems with no programming at all using RightEdge's drag and drop system creation.

    I should add as a disclaimer that I am one of the developers for RightEdge.
  3. Thanks for the reply. So you're saying that I can, for instance, have as one of the parameters of my "establish position" trigger "buy only if these particular moving averages are sloped up" with drag and drop functionality?

    If I'm going to spend time learning a language to backtest various strategies and ultimately automate various ones, I'd much rather learn C# than waste time with a scripting language that has extreme limits. I don't have much time to devote to learning C#, though, so the going is slow.

    Thanks again for the reply.
  4. In general I don't think you need to develop your own test environment.

    I am somewhat familiar with Wealth-Lab. Generating historical volatility or MA parameters is pretty plain vanilla stuff and is built-in. They use Pascal syntax to write their scripts. One nice thing about Wealth-lab is that you can run tests on an entire portfolio at one time rather than testing each security separately. That way you can run tests on classes of assets to generate aggregate results.

    Of course, what you've described so far could be coded in Excel in an afternoon but there is probably a lot more to what you are trying to do.
  5. Basically, yes. You can use an "And" trigger with any number of other triggers as inputs. The "And" trigger would only be triggered when all of its inputs were triggered at once.

    So in your case you would have one of the inputs a comparison trigger that compared a historical volitility indicator against some fixed value. The other input would be a trigger that detected whether the moving average was sloped upwards.

    What do you do to determine if the moving average is sloping up? The obvious thing to do would be to say it is sloped up if the SMA indicator value for the current bar is greater than the value for the same indicator on the previous bar. But that means that you are comparing the SMA of the price for bars 1 through 200 with the SMA of the price for bars 2 through 201. The values for bars 2 through 200 cancel out and you end up essentially comparing today's price with the price from 200 days ago. So I'm not sure if that's what you are looking for or not.

    Right now we don't have such a trigger but will probably add it if you want, and you could build something like it yourself in the drag and drop interface anyway.

    I hope that helps, ask away if it doesn't :)
  6. Thanks! You're right in that there are many more parameters, but it sounds like the popular products can handle them. I was afraid they could handle only the most basic (e.g., MACD crosses signal).

    I'm going to give that a shot. If I run into any problems, I will email or call you guys at RE. Thanks again!
  7. lindq


    You should look at Investor RT at

    Does everything you want to do, easier, and faster.
  8. taowave


    You definetly can get by with almost any product to code the things you are asking about..No offense,but that stuff will be coded in 5 minutes..