Hi QC team.
i'm recently writing a algo cosume Daily bars.
self.universe_settings.Resolution = Resolution.DAILY
the EqualWeightingPortfolioConstructionModel only triggers on 16:00:00 NY time. and the
market_order is transformed to be MOO by Lean framework. and then declined by Alpaca by their rule(shared the link below).
i don't know how could get around with this invalid order issue.
is it possible to make a regular OrderType.Market after market close? i just want the order to be executed the next trading day.
https://docs.alpaca.markets/docs/orders-at-alpaca#time-in-force
Invalidopg orders must be submitted after 7:00pm and before 9:28am
Mia Alissi
To address Oliver's issue with submitting a regular
OrderType.Market
after market close, here are some steps and considerations:Understanding Market Orders:
Using Market On Close Orders:
MarketOnCloseOrder
. This type of order is designed to fill at the official closing auction price for a security.Alpaca Brokerage Rules:
Algorithm Implementation:
MarketOnCloseOrder
if you want the order to be executed at the next market close. Here's a basic example of how to implement this:By following these steps, you should be able to submit orders that comply with Alpaca's rules and achieve your desired trading outcomes.
Sources: Market On Close Orders - QuantConnect.com, Market On Open On Close Algorithm, Market Orders - QuantConnect.com, Market On Open Orders - QuantConnect.com, Market On Close Order Buffer Regression Algorithm
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.
Oliver
the question is more about the the conflict of 1 and 2
2. Alpaca don't accept MarketOnOpenOrder on market close until 7:00pm
how can i make it work?
Oliver
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!