ranaroussi / quantstats

Portfolio analytics for quants, written in Python
Apache License 2.0
4.59k stars 809 forks source link

positions versus return #305

Open dorienh opened 10 months ago

dorienh commented 10 months ago

I am feeding results from backtrader into quantstats (returns, positions, transactions, gross_lev = portfolio_stats.get_pf_items()). I really like the nice reports it creates, but I have a question related to positions versus return.

In functions like win_loss_ratio(returns). The returns should be given as input. However, what if I open 5 positions per day, 4 lose and 1 is a big win. Then this metric would just show win for the day. Instead, is there any merit on feeding positions instead? Many of the stats have this kind of position/daily returns question.

Related, we could also input low/high, to get more accurate Sharpe ratio etc.