quantopian / pyfolio

Portfolio and risk analytics in Python
https://quantopian.github.io/pyfolio
Apache License 2.0
5.64k stars 1.77k forks source link

add cumulative returns computed from returns just in the returns distribution tails #69

Open justinlent opened 9 years ago

justinlent commented 9 years ago

Might be able to just tack these plots onto the "Stress Scenario" grid of plots

twiecki commented 9 years ago

As discussed: Use 2 standard deviations to filter.

justinlent commented 9 years ago

As I thought about this further I think the best way for us to visualize this is to plot just these > +/-2 standard deviation daily returns as a continuous equity curve. So basically just setting equal to 0 all returns that fall in between +/- 2 standard deviations, and then doing cum_return(only_tail_returns)

so by looking at this next to the overall equity curve of the algo we can visualize whether all of the tail returns are clustered near each other (e.g. like SP500 tail returns would be clustered in 2008/2009), as well as whether the negative or positive tail returns happen to to be auto-correlated with one another, etc.

as well, by plotting these tail returns by using cum_returns() it will allow for quick comparison with the overall algo cum_return, which will let us see whether all the "non-tail returns" really are just noise with mean=0, and thus all the algo's returns come from the tail returns!