I am currently live-trading an algo with the Alpaca integration, and would like my trades to be executed during extended hours. I notice Alpaca allows API users to submit limit orders that are eligible to be filled in extended-market hours, by submitting a boolean parameter to the orders themselves.
This implementation is a little different to QC's. I've seen other forum threads suggesting that after hours trading is possible with the IB integration (using extendedMarketHours=True in the AddEquity method). If I do the same and deploy the algo with Alpaca, will QC's API integration be smart enough to adjust my orders for me?
https://alpaca.markets/docs/trading-on-alpaca/orders/
Gahl Goziker
Hi P,
After hours trading with the Alpaca integration is indeed possible. By setting the optional variable
extendedMarketHours
in the AddEquity method to true, the security will send data during pre and post market sessions. QC’s API integration is indeed smart enough to adjust orders in response to this.AddEquity method arguments:
extendedMarketHours example:
self.AddEquity("SPY", Resolution.Hour, Market.USA, True, 2, True)
Best,
Gahl Goziker
P Chen
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!