I am confused, I have been running an algorithm I created this week in both backtesting and live simulated environment that incorporates a Tradier brokerage Model and utilizes “self.MarketOrder(symbol, quantity)” for the placing of my buy orders. It has been functioning perfectly as of this morning before market open, but it seems like something has changed today on Quant Connects backend because now I am received this error: “BrokerageModel declared unable to submit order: [1] Warning - Code: MarketOrderIsGtc - You cannot place market orders with GTC, only day orders are allowed” What would cause this logic to work perfectly up to this morning and now all of a sudden throwing an error that didn't exist before with the exact same code? Upon running the issue by GPT4 I am aware that QC's default for market orders is GTC (not sure why but that's another story) and Tradier doesn't support GTC market orders (I've never seen a broker have their market orders default to anything else but DAY but again besides the point right now…), but then why has this been working perfectly for days as I test this in backtesting & simulated environment, and now this morning I keep getting the error?
Brandon Collins
UPDATE: Strange why things were working for months prior perfectly and today things are different, but thanks to supports help,
adding the line: self.DefaultOrderProperties.TimeInForce = TimeInForce.Day
to my initializations method has fixed the issue. Thanks!
Brandon Collins
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!