Skip to content

Fill Model Don't Account IOrderPropeties.OutsideRegularTradingHours #9476

@AlexCatarino

Description

@AlexCatarino

Expected Behavior

If the data susbcription includes extended market hours, but the order property OutsideRegularTradingHours is false, the orders can't be filled.

Actual Behavior

OutsideRegularTradingHours is not accounted for.

namespace QuantConnect.Algorithm.CSharp
{
    public class GeekyRedDogfish : QCAlgorithm
    {

        public override void Initialize()
        {
            SetStartDate(2026, 5, 5);
            SetEndDate(2026, 5, 5);
            SetCash(100000);

            AddEquity("SPY", Resolution.Minute, extendedMarketHours: true);
        }

        public override void OnData(Slice data)
        {
            foreach (var kvp in data.Bars)
            {
                var symbol = kvp.Key;
                if (Time.TimeOfDay == new TimeSpan(9, 29, 0))
                {
                    OrderProperties prop = new TradeStationOrderProperties
                    {
                        TimeInForce = TimeInForce.Day,
                        OutsideRegularTradingHours = false,
                    };
                    var stopOrder = StopMarketOrder(
                            symbol,
                            10,
                            1.0m,
                            tag: "my tag",
                            orderProperties: prop
                        );
                }
            }
        }
    }
}

Potential Solution

N/A

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions