Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

An over fill was detected

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

    An over fill was detected

    Hi,

    I have a problem with an automated strategy. It works fine on market replay, bun on simulator I get the following error (attached):

    Click image for larger version

Name:	eroare.png
Views:	1
Size:	14.6 KB
ID:	896862

    Can someone help me to fix it?

    #2
    Hello SymeBB,

    Thanks for the post and welcome to the NinjaTrader forums!

    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.

    To reduce the chance of overfill, you should avoid having targets and stop losses so close to the market, avoid using CancelOrder() with orders close to the market, or watch out for Autoexpiration with orders close to the market.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hello SymeBB,

      Thanks for the post and welcome to the NinjaTrader forums!

      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.

      To reduce the chance of overfill, you should avoid having targets and stop losses so close to the market, avoid using CancelOrder() with orders close to the market, or watch out for Autoexpiration with orders close to the market.
      I have similar problem. My orders automatically expire, as I enter with liveUntilCancelled = false.

      What is the best way to avoid an overfill? Should I enter with liveUntilCancelled = true, and then at the end of the bar, cancel them manually, first checking whether the order is filled or partfilled?

      Or is there a better way?

      Thanks.

      Comment


        #4
        AntiMatter,

        Overfills chance depends entirely on how the strategy is coded and the situations that arise from this. They're caused when resting orders are near the market and cancel is issued. Orders can be cancelled by:
        • sending CancelOrder()
        • As part of an OCO group when another orders fills.
        • Autoexpiration when using liveUntilCancelled = false (default behavior for orders).
        • Due to internal strategy position management when the position associated with an order is no longer open.


        Overfill is when those orders are filled before they can be properly cancelled. Setting liveUntilCancelled = false and cancelling on every bar is no less likely to avoid. To prevent overfills you should be aware of resting orders near the market and coding appropriate control for these. More control is available when using advanced order handling and advanced event handlers.


        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        31 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by adeelshahzad, Today, 03:54 AM
        4 responses
        29 views
        0 likes
        Last Post adeelshahzad  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        17 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X