Group by direction #361
-
I would like to apply a strategy on a portfolio and backtest/groub_by the results by direction ( What I have so far:
So far, I am using
No, I am wondering how to best implement distinct backtests that incorporate Let's say I have five securities in my portfolio and I am going to test a single parameter combination, i.e. five columns in my At the end of the day, I am basically trying to replicate the example from within the docs (here with respect to
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@andreas-vester yes, you need to tile the price DataFrame three times and append a new column level "direction" (you can use |
Beta Was this translation helpful? Give feedback.
@andreas-vester yes, you need to tile the price DataFrame three times and append a new column level "direction" (you can use
price.vbt.tile
for this). You can then pass direction asdirection=price.columns.get_level_values('direction').values
.