• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Kate W.NinjaTrader Customer Service

    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:

      https://ninjatrader.com/support/help...#TheOrderClass

      Please let us know if we may be of further assistance to you.
      Kate W.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by daigo1, Today, 02:21 PM
      2 responses
      5 views
      0 likes
      Last Post daigo1
      by daigo1
       
      Started by Zapzap, Today, 02:24 PM
      0 responses
      7 views
      0 likes
      Last Post Zapzap
      by Zapzap
       
      Started by dynamictradingbars, Today, 01:56 PM
      0 responses
      3 views
      0 likes
      Last Post dynamictradingbars  
      Started by tarnation, Today, 01:25 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by iq200, Today, 01:00 PM
      2 responses
      10 views
      0 likes
      Last Post iq200
      by iq200
       
      Working...
      X