I have a historical PMwR journal of trades (one for each side of position open/close) in R.
I wish to backtest trade sizing algorithms, one of the inputs to which calculation will be, on-the-day total value of the portfolio prior to execution of each open.
I would prefer to do this within PMwR.
From the docs, I can't see how to access total portfolio value (or related 'path-dependent' numbers for example 'cash position', 'on the day' inside a backtest. Is this available within the framework, or do I need to maintain P&L etc externally in a Global via some explicit loop?
Does anyone have an example of backtesting trade sizing using PMwR, in a situation where pre-trade total portfolio value, current holdings in each instrument, etc are inputs for the sizing algorithm?
I am also open to non-PMwR solutions, but I appreciate its clarity and elegance and would prefer to stay within it if possible.