PDA

View Full Version : Matlab for Backtesting



Alfredhob
04-21-2017,
I have been building mechanical trading models in excel for a time now, but have decided that i need to move on to something more powerful for future models.
The attached spreadsheet is a small example of how I have typically built models. Trade signals are shown as a 1, generated by various methods not shown. A trailing stop handles the exit.
Has anyone built a model in Matlab similar to this, or has seen something on the net where I could gain some insight to cut down on my learning curve?
I want to use matlab for its optimisation abilities, but my biggest problem has been how to get the trade entries/exits/PnL to work.

AndrewAbugs
04-23-2017,
Haven't done anything similar, but there are some excellent webinars on the Mathworks site.

AlmoPa
04-23-2017,
I have viewed the webinars, but it deals more with the optimisation once the framework is set up. I have been able to import my data and generate entry/exit signals, but am having trouble with calculating the profit of trades. Has anyone has experience with this before?

AmandaSa
04-24-2017,
You could have a sift around on this blog Quantitative Trading (http://epchan.blogspot.com/) as the guy uses Matlab for his quantitative strategies. I have just bought his book which has some examples of Matlab coding, mainly for strategy back-testing, however I really couldn't recommend it yet as I haven't finished reading it. Perhaps have a browse at your local B&N.