Back

Forex Portfolio Balancing

Dear Everyone,

I would like to request help from more experienced people on actually what I believe should be a very common issue. I want to deploy my portfolio balancing model to QuantConnect, which takes log-returns during the past 256 hours of different assets as input and returns a vector of which the absolute value sums to 1.0 (This vector basically represents the long-short positions of the assets). I would like the portfolio to be re-balanced accordingly via Immediate Execution.

Since that I am very new to QuantConnect, I have investigated the framework algorithms for this purpose. As far as I understand, what I need is to basically modify a portfolio construction model in framework algorithms. However, since that I was also unable to use Python debugging functionalities that are provided by Visual Studio. I could not figure out how or where I can retrieve such numpy array or pandas dataframe consisting of hourly returns of assets, and then basically use them to compute the portfolio targets while relying the existing modules for the rest of the execution.

Consequently, I would be more than glad if an example source code or a portfolio construction template can be provided, which demonstrates how portfolio optimization (allocation) can be done for periodically rebalancing weights of a long-short portfolio by employing the historical log-returns. Thank you for your time and consideration. Have a nice weekend.

Sincerely,
Kamer

 

 

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I have managed to do this via a classic algorithm, but would still appreciate having a framework algorithm example so that I can easily use more advanced order execution, etc modules there rather than setHoldings.

0

Hi Kamer,

Glad to hear you're so interested in Framework Algorithms. I just posted a reply to another post you made here and attached an example of a Framework Algorithm. Hopefully, this helps put you on the right track!

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed