Hi,
What is the effect of funding a broker account? It is difficult to test what the algo would do. I am running this algo:
https://www.quantopian.com/posts/long-only-strategy-allocate-between-bull-and-bear-market-portfolios
J.
Hi,
What is the effect of funding a broker account? It is difficult to test what the algo would do. I am running this algo:
https://www.quantopian.com/posts/long-only-strategy-allocate-between-bull-and-bear-market-portfolios
J.
Hi J,
That strategy looks like its using order_target_percent to allocate capital between the bull and bear market portfolios. If I interpret your question correctly you're asking what will happen if you deposit additional cash into your IB account, say after market hours?
Each minute during the trading day your Quantopian algorithm synchronizes its portfolio object with the values in IB, if you were to deposit an additional $5k in your account overnight your Quantopian algorithm would pull that higher cash balance in at 9:31am the next mornings. The next time your algorithm rebalances (depending on when the last rebalance occurs this could be up to 20 days if you left that setting as David had it) that capital would be allocated out according to the weights determined by the logic. So for example, if your algorithm says your portfolio should be 50% in the bull portfolio and 50% in the bear portfolio then that new $5k would be split evenly with an additional $2500 be allocated to each set of stocks.
Please let me know if that doesn't fully answer your question. Thanks for sharing your progress on live trading!
Best wishes, Jess
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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.
Hi Jessica,
Thank you for your reply. This is indead what I mean. It rebalances every 20 days. I started a couple of days ago so it would act on the new account balance till next moment to rebalance. If I would like the algo to immediately balance the cash in the account I would do next:
Is there a way to tell the backtester that the account balance has changed to see what the algo does exactly? Wiring in and out money to IB is a bit tedious.
J.
Hi J,
That's correct, your best plan is to do as you say and stop/restart your live algo to initiate an immediate rebalance.
We don't have a great way to test account deposits/withdrawals in backtest, we have certainly had this requested in the past and I know its on our feature list, though I don't have an ETA for you at the moment. For now I think that safest course is to manually stop/start your algo when you know your account balance is going to change due to a deposit or withdrawal.
Best wishes, Jess
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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.
Hi Jessica,
The balance has been increased and I stopped the algorithm. I then redeployed it. However, it states 'Error' and I cannot see what error is going on.
J.
Hi J,
We also noticed in our logs your algo is incorrectly displaying an error state. We took a look and the algorithm is fine; it will start up tomorrow morning and begin pulling in market data at 9:31AM at the first run of handle_data. It will request the account information from IB and receive the latest account balance.
There is no need to take any actions - we figured out why this problem occurred and its been fixed. If you have any questions let us know!
Thanks,
Alisa
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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.
Hi Alisa,
The algo is running now. However, it did not rebalance on start as expected. I transfered EUR to the account. The account has USD as base currency. Do I need to buy USD on this account first?
J.
Hi J,
It looks like that algo is set to rebalance at 11am, I think the rebalance just hasn't triggered yet. Can you let us know if it does/doesn't rebalance in the 11-11:30 window?
Best wishes,
Jess
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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.