Saturday, November 17, 2012

Some tips on backtesting in quantstrat


You might run into odd errors when backtesting strategies on tickers Ford (F) and ATT (T) in quantstrat. Since F is also reserved word False and T is shorthand for TRUE these ticker symbols will likely result in errors. Assigning F <- TRUE and T <- FALSE before backtesting will be a workaround as long as TRUE and FALSE is used elsewhere in the backtests.

Stoploss creation is a bit tricky. One has to use order-sets to get the exit orders cancelled once either target or stop is filled.

If you want to use limit orders you should use the "prefer" parameter to specify a column which contains the price for the limit order, "prefer" can be used for all columns in mktdata.


No comments:

Post a Comment