Closed skollar closed 3 months ago
You need to pack your asset prices into a single DataFrame and run any Portfolio.from_*
method with group_by
set to True. If the basket should share the same capital, set cash_sharing
to True (see examples).
Any order management logic can be implemented using Portfolio.from_order_func
, where you pass an order function that is then called every tick (see examples). But note that vectorbt allows only one order per tick and asset, since the solution is built on top of NumPy arrays that cannot grow efficiently.
Hi @polakowo the example links above return page 404 not found. Do you have any examples on constructing a multi-asset portfolio? Thanks!
This might be the new link: https://vectorbt.pro/tutorials/portfolio-optimization/
Is there a way to add a bag of assets in a single portfolio. ie [ AAPL, MSFT, GOOG]. Goal is to view the effect of a strategy in a set of non correlated assets.
Is this feasible? Is there any hooks to add custom order management based on current open orders?