[R-SIG-Finance] Quantstrat - applystrategy on subset of mktdata

Brian G. Peterson brian at braverock.com
Thu Dec 15 17:38:41 CET 2016


On Thu, 2016-12-15 at 06:31 +0000, Mayank Singhal via R-SIG-Finance
wrote:
> I am interested in backtesting the strategy on subset of mktdata  but
> somehow the below approach is resulting into errors.
> ################# yy="2016"out<-applyStrategy(strat.st ,
> portfolios=portfolio.st, mktdata = mktdata[yy])
> ##################
> I understand i can do it in 2 steps where in first step i calculate
> indicators/signals on the full time series and in second step only
> supply the subset of mktdata to portfolio for backtest.  But i was
> wondering if there is a way to do this in single step itself ? I
> think the problem is that the full mktdata is added to portfolio.st
> and not the subset of it ?
> Any pointers will be helpful,
> Regards,Mayank

You don't give enough information here for anyone to help you.

Please follow the Posting Guide:

https://www.r-project.org/posting-guide.html

and create a minimal reproducible example.

Also, per the posting guide, don't post HTML, as it makes your
formatting impossible to cut and paste from, even if there were a full
example here.

Brian



More information about the R-SIG-Finance mailing list