Aggregating stats #375
Unanswered
andreas-vester
asked this question in
Q&A
Replies: 1 comment
-
@andreas-vester use Pandas, there is a reason why vectorbt returns a multi-index (you're interested in group_by). In |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I set up a portfolio backtest using different values for two input parameters (
mlr_window
andsma_window
), splitting the dataset usingvbt.rolling_split
, and differentiating betweenlong_only
,short_only
, andboth
.Here's the
from_orders
function with the actual grouping:Here are the final columns
I've got some questions regarding grouping/indexing/aggregating.
Let's take the annualized returns as a first example:
(How) is it possible to, let's say, compute the mean for all
split_idx
for every distinctmlr_window
andsma_window
parameter combination [(50, 100), (50, 150), (60, 100), (60, 150)]? That would reduce the number of rows to 12 (four avg. ann. returns per direction).Or how can I compute the min/max ann. return per direction?
How would I perform these aggregations when I am using
port.stats()
?Beta Was this translation helpful? Give feedback.
All reactions