braverock / blotter

blotter provides transaction infrastructure for defining transactions, portfolios and accounts for trading systems and simulation. Provides portfolio support for multi-asset class and multi-currency portfolios. Actively maintained and developed.
112 stars 48 forks source link

chart.Posn initial artificial drawdown #72

Open cdries opened 6 years ago

cdries commented 6 years ago

https://github.com/braverock/blotter/blob/bc75cf57b1a3d17561f026685f2c2c7c33d011f5/R/chart.Posn.R#L67

This line causes an initial artificial drawdown the size of the maximum cumulative PL to happen at the start of drawdown series. I think this line can be removed without any consequences.

For an example of this, run the demo code https://github.com/R-Finance/blotter/blob/master/demo/longtrend.R up to line 117 where chart.Posn is called.

braverock commented 6 years ago

I think we could make this an option.

It is there to force the scale of the cumPL and Drawdowns panels to be the same. I think we put it in before there was a reliable ylim mechanism for panels in chart_Series. I think that with plot.xts we could probably do something smarter to evaluate ylim for the panels, though @rossb34 would know for sure.