Back

Advice: Withdraw funds from account without disrupting algorithm

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:

  1. Stop algorithm
  2. Manually sell off part of each position to fund withdrawal
  3. Withdraw funds
  4. Re-start algorithm
This introduces extra orders and also the potential that the algorithm is confused by the new order quantities.I'd like to think there was a better way to do this. Ideally, I'd like to withdraw at a rebalance point, so no extra orders have to be submitted. I'm thinking something as follows:
  1. Somehow inform algorithm that an x% withdrawal is requested (daily download of file with instructions?)
  2. On next rebalance, tell PortfolioConstructor to generate quantity targets based on accout balance - x% (can this be done?)
  3. Send quantity targets to Execution model, which will free up x% of the account for withdrawing
  4. Withdraw x% of funds
As asked above, is it possible to generate quantity targets based on a fictional account balance? If not, do you have any advice on how to efficiently withdraw funds?
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.


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)

0

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. 

0

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?

0

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.

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