Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Order not filling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Market Order not filling

    Hi,
    I think I recall posting about this sometime ago but I can't find the thread now.

    I have a strategy that sends a market order to enter but it never fills.
    The strategy trades fine for a while (these are historical bars I'm talking about). Yet in this example a target fills during a bar that (at its Close time) creates a signal to Enter Long.
    This is done correctly (from within OnBarUpdate) and monitoring OnOrderUpdate() shows that the order reaches OrderState.Working.

    Then nothing happens. No fill. How can a market order never fill?

    This is not a complicated strategy. Just chart bars (1 minute).
    See below. (I've cut off the remainder of the log but take my word on it that nothing ever happens again in OnOrderUpdate, OnExecution or OnPositionUpdate. The market order permanently is working, unfilled.
    Version 8.0.20.1

    saltminer.
    Attached Files

    #2
    Hello saltminer,

    Thank you for your post.

    Was this on real time data or in Replay or the Strategy Analyzer?

    I would like to take a look at both your log and trace files and your strategy code if you are comfortable with that. I'll have you send them in to us directly and not through the forum, since the log and trace files can contain personal information.

    You can export your strategy by going to Tools > Export > NinjaScript Add On. Please do not check the box to export as a compiled assembly or I will not be able to review your code. Once you've gotten it exported, you can then go to the Control Center-> Help-> Email Support.

    Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default. Please use the Attachment field at the top and attach your strategy as well.

    Please reference the following ticket number in the body of the email: ##REQUESTID## ATTN ##ASSIGNED_FIRST##

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hello saltminer,

      Thank you for your reply via email.

      I've been testing with your strategy and it looks like most likely it is happening because you're not setting the values for LE, SE, LT, ST, LS, SS, and ExitOrder back to null when the order is cancelled or completed. So what happens when you try to transition to State.RealTime is that you're trying to transition orders that are no longer active and you get this strange stopping behavior. You would want to make sure you're setting those order references to null when the order is in a terminal state, otherwise you'll run into this issue.

      There's an example on this page of our help guide that shows resetting an order variable to null when the order is filled:



      Please let us know if we may be of further assistance to you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X