Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:



      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 TraderBCL, Today, 04:38 AM
      2 responses
      7 views
      0 likes
      Last Post TraderBCL  
      Started by martin70, 03-24-2023, 04:58 AM
      14 responses
      105 views
      0 likes
      Last Post martin70  
      Started by Radano, 06-10-2021, 01:40 AM
      19 responses
      606 views
      0 likes
      Last Post Radano
      by Radano
       
      Started by KenneGaray, Today, 03:48 AM
      0 responses
      4 views
      0 likes
      Last Post KenneGaray  
      Started by thanajo, 05-04-2021, 02:11 AM
      4 responses
      471 views
      0 likes
      Last Post tradingnasdaqprueba  
      Working...
      X