[R-SIG-Finance] apply.paramset trade-by-trade PnL data
Brian G. Peterson
brian at braverock.com
Tue Feb 2 17:55:02 CET 2016
On Tue, 2016-02-02 at 16:29 +0200, Jersey Fanatic wrote:
> results <- apply.paramset(strategy.st,paramset.label = "MACD_OPT",
> portfolio=strategy.st, account=strategy.st,
> nsamples=0,verbose = FALSE)
>
Your problem is here. You're not setting an 'audit' environment.
paramsetenv<-new.env()
results <- apply.paramset(strategy.st,paramset.label="MACD_OPT",
portfolio=strategy.st, account=strategy.st,nsamples=0,verbose = FALSE,
audit=paramsetenv)
ls(pos=paramsetenv)
#note that paramsetenv will have the portfolio for each parameter set.
#results$tradeStats will give you summary statistics for each paramset.
# see: http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf
# p.42-43 on paramsets,
# and p.62-67 on walk forward testing, which uses the audit environment
>
> 2016-02-01 12:43 GMT+02:00 Jersey Fanatic <jerseyfanatic1 at gmail.com>:
>
> > Transaction table from applyStrategy() lists transaction dates and
> PnL in > trade-by-trade basis. However, after executing
> apply.paramset() on a > distribution of parameters, same
> trade-by-trade
> PnL statistics is not > retrievable via getTxns(). Is there a way to
> access trade-by-trade PnL data > results from *apply.paramset()* for
> each combination tried in the > optimization range? My end goal is to
> construct a time-aligned data table > with hourly/daily/weekly PnL for
> each combination of parameters. > > > 2016-02-01 9:12 GMT+02:00 Jersey
> Fanatic <jerseyfanatic1 at gmail.com>: > >> Transaction table from
> applyStrategy() lists transaction dates and PnL in >> trade-by-trade
> basis. However, after executing apply.paramset() on a >> distribution
> of parameters, same trade-by-trade PnL statistics is not >>
> retrievable
> via getTxns(). Is there a way to access trade-by-trade PnL data >>
> results from applyStrategy for each combination tried in the
> optimization >> range? My end goal is to construct a time-aligned data
> table with >> hourly/daily/weekly PnL for each combination of
> parameters. >> >> Thanks for the help in advance. >> > >
More information about the R-SIG-Finance
mailing list