Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do we trap an Overfill?

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

    How do we trap an Overfill?

    After receiving more Overfills that do not make sense: there was an Exit order to exit a short in one account, and an Entry order for a long in another, completely different account. They triggered at the same time, by the same condition, and I got an Overfill message.

    Therefore, I am exploring IgnoreOverfill, so that I can handle the situation on my own code. The problem is that looking through the log and the literature, I do not see how to trap the message of an Overfill. The only information seems to be, what the, obviously named, instruction does, and a dire warning to be careful. Where is the information on how my code will know that an Overfill has occurred, even as it ignores same?

    #2
    Hi koganam,

    If there has been an overfill on an order the IOrder handle will have an Overfill object that will be true.

    For example:

    private IOrder myOrder = null;

    myOrder = EnterLongLimit();

    if (myOrder.Overfill == true)
    // overfill detected
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hi koganam,

      If there has been an overfill on an order the IOrder handle will have an Overfill object that will be true.

      For example:

      private IOrder myOrder = null;

      myOrder = EnterLongLimit();

      if (myOrder.Overfill == true)
      // overfill detected
      Thanks. Surprising that I did not see that when I RTFM: it is right in there, clear as day. Oops. Jeez.

      Comment


        #4
        Hi koganam,

        Very small oversight when compared to your level of mastery of NinjaScript-fu.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi ChelseaB,

          That way to detect an overfill, could it be done just in OnBarUpdate ? or does it go into OnOrderUpdate ?

          Thanks

          Comment


            #6
            Hi pstrusi,

            You can check an IOrder status from the IOrder.OrderState object to see if it is overfilled from OnBarUpdate or from any of the other real time methods. However, this would be slower than checking this in OnOrderUpdate.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hi koganam,

              If there has been an overfill on an order the IOrder handle will have an Overfill object that will be true.

              For example:

              private IOrder myOrder = null;

              myOrder = EnterLongLimit();

              if (myOrder.Overfill == true)
              // overfill detected
              How would it be if from a CancelOder ? where can I check that?

              I was given a great example in this forum:
              protected override void OnOrderUpdate(IOrder o)
              {
              if(o.OverFill)
              Print("Over fill");
              }
              Thanks


              NOTE: I'm sorry I've post this message after your quick answer :-)
              Last edited by pstrusi; 09-29-2015, 02:38 PM.

              Comment


                #8
                Hi pstrusi,

                If an order was cancelled the IOrder.OrderState will be cancelled.

                This again is faster to check in OnOrderUpdate but an be checked in OnBarUpdate.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                332 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X