Daily Absolute PnL For A Strategy
Is there a way to get the absolute daily PnL for a strategy? I am aware of the Time Return analyzer, but it calculates the returns on the beginning of a timeframe. What I require is, say if I am testing a strategy from Jun 1, 2019 to Sep 1, 2019, then I want to get daily profit / loss (in absolute sense rather than a percent return) as well as cumulative profit / loss for this time period. Is there a direct way to do this, without having to calculate the same via Time Return?
I believe that
TimeReturnanalyzer with the
timeframeparameter set to
TimeFrame.Dayswill calculate daily returns in %s. So at first glance the easiest way will be just to repeat
TimeReturnanalyzer code with the small change:
self.rets[self.dtkey] = (self._value / self._value_start) - 1.0
self.rets[self.dtkey] = self._value - self._value_start
@ab_trader Thanks. So apparently, inheriting TimeReturn would be the only elegant way to go forward. I implemented that and it works perfectly.