No announcement yet.

Partner 728x90


Overfill... What is it?

  • Filter
  • Time
  • Show
Clear All
new posts

    Overfill... What is it?


    I have recently started running a pair of strategies on a live data NT account.

    About once a day a message pops up about an overfill occurring.

    At this point, my strategies enter a trade, but do not reach their stop losses. Rather, the orders are cancelled mid way (regardless of the value of the market itself - somewhere in between my stop loss range).

    So the strategies place an order, then I get the message about overfill occurring, then the orders get cancelled, and then my strategies are disabled. At this point i have to go in manually and re-enable the strategies.

    I've tried reading a bit about overfill, but mainly I am getting information about how to disable this overfill with a line in the code. I'm not sure that I want to do this, as I don't fully understand what the purpose of the overfill is..

    Can you please explain to me what an "overfill" is exactly, and why it may occur?

    Thank you.

    Hello WilliamW,

    Thanks for opening the thread. Over Fills describe an occurrence where an order is filled or partially filled after the order was already marked for cancellation. The way these occurrences happen is subjective to the strategy logic and execution. Our help guide has the following explanations which may shed more light:

    Over-Fills is a serious issue that can occur when using complex entry conditions that bracket the market in both directions end up with both entries being filled instead of one being cancelled. Over-Fills can also occur when you place a trade quickly hoping to close a position while a prior order to close the same position already had an in-flight execution. The exact scenarios in which an over-fill can occur is highly dependent on the specific strategy programming. By default, NinjaTrader will protect against over-fills even though you are using the Unmanaged approach by halting the strategy, but should you decide to custom program your own over-fill handling it is up to you to either prevent over-fills from being a possibility in your code or by introducing logic to address over-fills should one occur.

    An overfill is categorized as when an order returns a "Filled" or "PartFilled" state after the order was already marked for cancellation. The cancel request could have been induced by an explicit CancelOrder() call, from more implicit cancellations like those that occur when another order sharing the same OCO ID is filled, or from things like order expirations.

    The recommended resolution is to try to create scenarios which had caused an Over Fill in the Market Replay connection to reproduce the over fill to troubleshoot how you can manage the cancellation of your orders.

    Over Fills caused by a pending in flight execution may be harder to reproduce. For example, quickly attempting to close a position while a pending order at the broker already closes the position will not be as easy to reproduce locally. These sorts of scenarios should be minded while writing the strategy, and you can use IgnoreOverFill and further logic in OnOrderUpdate() to identify and handle Over Fills.

    IgnoreOverFill —

    OnOrderUpdate() —

    TraceOrders —

    Market Replay —

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service


    Latest Posts


    Topics Statistics Last Post
    Started by DTSSTS, Today, 11:12 AM
    0 responses
    1 view
    Last Post DTSSTS
    by DTSSTS
    Started by GFHXFGHFGH, Today, 11:03 AM
    0 responses
    Last Post GFHXFGHFGH  
    Started by TraderJosh, 11-20-2023, 02:54 PM
    2 responses
    Last Post TraderJosh  
    Started by xiinteractive, 08-08-2023, 11:55 AM
    33 responses
    Last Post Keyboard1  
    Started by ga8riel, 07-31-2023, 09:44 AM
    3 responses
    1 like
    Last Post Keyboard1