satrapade / multiasset

0 stars 0 forks source link

selected outcome and selection P&L plot have inconsistent time periods #8

Open nassuphis opened 6 years ago

nassuphis commented 6 years ago

image

nassuphis commented 6 years ago

roll date is Sep expiry, P&L should be from Sep to Dec, its from Dec to Mar instead.

nassuphis commented 6 years ago

pday is not the row index, it does not start from 1

> range(strategy_df$pday)
[1]   51 5527
> pnl
            date    pnl
   1: 1996-03-15  0.000
   2: 1996-03-18  0.005
   3: 1996-03-19  0.006
   4: 1996-03-20  0.006
   5: 1996-03-21  0.004
  ---                  
5473: 2017-12-08 -0.258
5474: 2017-12-11 -0.254
5475: 2017-12-12 -0.253
5476: 2017-12-13 -0.253
5477: 2017-12-14 -0.258
> 
nassuphis commented 6 years ago

start and end in strateegy_df need to be dates, not indices.

nassuphis commented 6 years ago

or we store the pday value with the result and search on this.

nassuphis commented 6 years ago

storing pday with p&l works image