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
Uh oh!
There was an error while loading. Please reload this page.
-
I set up a portfolio backtest using different values for two input parameters (
mlr_windowandsma_window), splitting the dataset usingvbt.rolling_split, and differentiating betweenlong_only,short_only, andboth.Here's the
from_ordersfunction 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_idxfor every distinctmlr_windowandsma_windowparameter 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