Hi All,
Lets say we start with $100,000
We go short MSFT 50% of the money (sold shares worth $50,000)
Next week MSFT loses let's say 10%, then Portfolio will have $105,000, and the cash is $50,000, but 50% in this case is $52,500.
Then we execute Setholdings("MSFT", 0.5).
Does this lead to buying back all the shares we were short and on top of this buying some MSFT shares for remaining $2500 in order to reach trading for $52,000 ?
Thanks
Nik
Jared Broad
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.
Jared Broad
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.
Reuben
Liquidate(symbolA); Liquidate(symbolB); SetHoldings(symbolA, .50); SetHoldings(symbolB, .50);
As I understand it, this is the simplest way to model rebalancing would be to use the above, although I realize it adds extra transactions. For actual implenetation I would want to use a Rebalance method that would only add/subtract the appropriate number of shares. Am I understanding the SetHoldings method correctly?Michael Handschuh
Nik milev
Stephen Oehler
John Radosta
"So if you currently hold 25% of your portfolio in AAPL and call SetHoldings(AAPL, 0.50), then the algorithm will attempt to purchase an extra 25% worth (the delta) to achieve the 50% target."
Does the opposite hold true as well? If you hold 100% of your portfolio in AAPL and you call SetHoldings("AAPL", 0.50), will that liquidate only 50% of your holdings?Â
Jared Broad
>If you hold 100% of your portfolio in AAPL and you call SetHoldings("AAPL", 0.50), will that liquidate only 50% of your holdings?
Short answer yes. Long answer it'll calculate the number of shares for 50% of holdings, and find the difference between holdings+open orders to the target quantity; then place the trade for the difference. The result will be 50% of holdings AAPL.Â
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.
Nik milev
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!