<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi,</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I would first like to thank the creators of quantstrat and related packages for their excellent work. It is so much easier to backtest strategies using these as compared to MATLAB/Excel. </div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

I have been working on creating a simple backtest for the Turtle rules using quantstrat based on the blotter demo and have had excellent guidance and great help from Joshua Ulrich. </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I am currently facing the problem that my backtest does not seem to take all the trades that it should. I have changed the parameters a little bit and wonder if that is what is causing the problems. </div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

e.g: If the rule is to go long above the 10-day high, my backtest misses the first time the asset class crosses the appropriate level. I am wondering if this is happening in multiple places because I have backtested the same strategy in MATLAB and the results are almost mirror images of each other. I am attaching my code, one data set and a portion of the mktdata variable. There should be a long trade on day 14 in mktdata that is missed. </div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

My code is currently missing Turtle like position sizing.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

Would love to have feedback. </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

Thanks,<br clear="all"><div><br></div>Nisseem S. Nabar<br><a href="http://in.linkedin.com/in/nissimnabar" target="_blank" style="color:rgb(17,85,204)">http://in.linkedin.com/in/nissimnabar</a></div>