I just started using QuantConnect recently, and I must say it's one of the best cloud platform I've used. However I'm finding it difficult to understand the S⊤MarketOrder stop order. Let's say I'm holding 500 shares of SPY, and I want to close the position immediately SPY reaches a particular price
self.StopMarketOrder(self.spy.Symbol, -500, 0.90 * self.Securities[self.spy.Symbol].Close)
When the stop price is triggered, does it close the position or it SELL/SHORT it. ?
Fred Painchaud
Hi Obimba,
If you hold 500 SPY, it will sell your 500 SPY. A negative quantity is selling, a positive one is buying. If you sell something you do not hold, you are short selling. It will put you in a negative position (-500 SPY for instance). Then, when you buy back 500 SPY, you'll reach 0 and you will then exit your short position.
In an nutshell…
Fred
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.
Obimba Smart Chukwunenye
Thanks for your reply. But I'm still not getting it.
I'm trying to update my ‘MarketOrder’ ticket to a new stop loss: that's exciting the position
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!