Hi All,

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.