quantopian / pyfolio

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

Histogram plot of $ADTV for each stock ever traded in portfolio #135

Open justinlent opened 9 years ago

justinlent commented 9 years ago

Where, $ADTV is Average Daily Trading Volume in $ terms:

$ADTV = average( close_price * volume_shares , 90 )

which would be the average $ traded in the security over the last 90-days

This will allow us to do a quick visual analysis of the capacity/liquidity contraints of an algo, and whether it's an algo that could efficiently trade $10k, $100k, $1M, $10M, etc.

humdings commented 9 years ago

Would it also be useful to calculate the percentage of daily volume that an algo traded?

justinlent commented 9 years ago

@humdings yep definitely. I think the plot you recommend would need to be the % of ADTV for each ticker in the algo on a daily basis, and this would offer a great deal of insight into the the capacity constraints of the algo - but if the algo holds say 100 tickers per day it might be a tough plot to visualize. Thoughts?

humdings commented 9 years ago

It might be easier to just report a few tickers that traded the highest percentage of their average daily volume. For the plot I think an average for the whole portfolio would suffice. This sounds like a pretty useful thing to have.

justinlent commented 9 years ago

+1 @humdings Showing just like a Top 10 List of the stocks traded by the algo based on their %ADTV sounds great. I think we can create 2 or 3 separate plots from the ideas generated in this thread and call the whole section of plots something like "Capacity Analysis"

twiecki commented 9 years ago

@humdings Any progress on this? Seems like the last item for 0.2 although we can probably also go ahead without it.

humdings commented 9 years ago

No, I've been too slammed with other things lately, it should slow down a bit for me after next week though.

twiecki commented 9 years ago

OK, no worries.