Added an implementation of The ETF Trick to model a set of instruments given a dynamic set of weightings. I've updated Portfolio.ipynb with example usage.
The resulting time series reflects the value of $1 invested in a set of instruments. The series is strictly positive and can take rebalance costs, bid-ask spread costs, and missing data into account, though some work remains to extend it to those use cases.
To extend this beyond cash-settled instruments, one can also model a basket of futures as if they were a single non-expiring cash product with this method, but I think we'd need another function to handle the rolls of those futures contracts.
This idea comes from Advances in Financial Machine Learning by Marco Lopez de Prado.
Added an implementation of The ETF Trick to model a set of instruments given a dynamic set of weightings. I've updated
Portfolio.ipynb
with example usage.The resulting time series reflects the value of $1 invested in a set of instruments. The series is strictly positive and can take rebalance costs, bid-ask spread costs, and missing data into account, though some work remains to extend it to those use cases.
To extend this beyond cash-settled instruments, one can also model a basket of futures as if they were a single non-expiring cash product with this method, but I think we'd need another function to handle the rolls of those futures contracts.
This idea comes from Advances in Financial Machine Learning by Marco Lopez de Prado.