Hi,
I am running an algorithm that rebalances once or twice a week. It is relatively heavy in its usage of margin, so I can't withdraw without first selling off assets. I've been thinking about how to withdraw funds from the account without disrupting the flow and without too much manual work.
The most manual approach would be to:
- Stop algorithm
- Manually sell off part of each position to fund withdrawal
- Withdraw funds
- Re-start algorithm
- Somehow inform algorithm that an x% withdrawal is requested (daily download of file with instructions?)
- On next rebalance, tell PortfolioConstructor to generate quantity targets based on accout balance - x% (can this be done?)
- Send quantity targets to Execution model, which will free up x% of the account for withdrawing
- Withdraw x% of funds
Michael Manus
that is actually a good idea,
yes use dropbox to tell the algo to sell some stuff.
(there are a lot of examples with dropbox acess in sample database on github as you already have seen it. that would work)
Douglas Stridsberg
Hey,
My main question is about whether you can simulate a lower account balance when submitting a portfolio target. But I suspect you should be able to simply multiply the desired weight by 1-x and use that in the next rebalance instead.
I'll see if I can build something modular and perhaps share it with the community. I suspect I'm not the first to think about how to automate withdrawals.
Michael Manus
did you try to play around with:
Portfolio.TotalPortfolioValue ?
If you start your algo you could get substract from this Value x and calculate quantity for the rest?
Jared Broad
Assuming you have deep knowledge of how the algorithm works - you could manually sell some positions through the web IDE, and withdraw cash via your brokerage, and then the next morning at 0745 we will re-synchronize the portfolio cash available. Hopefully, it'll all work! The official recommendation would be the manual approach you mentioned above.
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.
Douglas Stridsberg
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!