[R-SIG-Finance] Quasi-Turtle Strategy Implementation in quantstrat

Nisseem Nabar 8nabarns at iimahd.ernet.in
Wed Oct 3 10:42:23 CEST 2012


Hi,

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.

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.

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.

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.

My code is currently missing Turtle like position sizing.

Would love to have feedback.

Thanks,

Nisseem S. Nabar
http://in.linkedin.com/in/nissimnabar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121003/cde6d4e4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: funTurtles_qsDemo.R
Type: application/octet-stream
Size: 10938 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121003/cde6d4e4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Crude.csv
Type: text/csv
Size: 112810 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121003/cde6d4e4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CrudeMktData.csv
Type: text/csv
Size: 21884 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121003/cde6d4e4/attachment-0001.bin>


More information about the R-SIG-Finance mailing list