Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Overfill... What is it?

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

    Overfill... What is it?

    Hello,

    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.

    #2
    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.
    https://ninjatrader.com/support/help...d_approach.htm

    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.
    https://ninjatrader.com/support/help...reoverfill.htm

    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 — https://ninjatrader.com/support/help...reoverfill.htm

    OnOrderUpdate() — https://ninjatrader.com/support/help...rderupdate.htm

    TraceOrders — http://ninjatrader.com/support/forum...ead.php?t=3627

    Market Replay — https://ninjatrader.com/support/help...ket_replay.htm

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    23 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    45 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    22 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X