How can I prevent trades from executing during pre-market or after-hours for U.S. stocks?
Posted: May 26 2024
The trading hours for the U.S. stock market are from Monday to Friday, 9:30 AM to 4:00 PM Eastern Time. However, in MultiCharts, when receiving data from Interactive Brokers, the trading hours are extended from 8:00 AM to 6:30 PM, including one and a half hours of pre-market and two and a half hours of after-hours trading.
If I have a live strategy with stop orders, like the code below:
In this scenario, the stop orders might be triggered during the pre-market or after-hours sessions, which will result in entries being displayed on the chart. How can I ensure that the strategy does not execute during these periods? Can this only be achieved by modifying the exchange's trading start and end times in QuoteManager?
Thank you so much for your help.
If I have a live strategy with stop orders, like the code below:
Code: Select all
if Time >=0901 and Time <=1601 then begin
buy 1 contract next bar at 2000 stop;
end;
Thank you so much for your help.