Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO order overfill detected on strategy

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

    OCO order overfill detected on strategy

    I have read postings regarding this subject but without success.

    The error message "OCO order overfill detected on strategy" occurs under a very specific scenario.
    1) Place an Order for quantity of 2
    2) Partial fill of profit target of quantity 1
    3) Stop Loss of quantity 1

    My strategy looks something like this:
    SetProfitTarget (OrderName,CalculationMode.Ticks,profitTarget);
    SetStopLoss(OrderName,CalculationMode.Ticks,stopLo ss,false);
    EntryOrders = EnterLongLimit(0,true,PositionSize,LimitPrice, OrderName)

    I don't send a CancelOrder () command, the error occurs as soon as the stop loss is reached.I would greatly appreciate any suggestions that would prevent the strategy from creating this error. Thanks.

    Note: I am doing my tests with market replay.
    Last edited by drachma; 11-17-2010, 12:48 PM.

    #2
    Hello drachma,

    Generally this should not be the case. When partial fill is noted on the target, then the stop loss and remaining target quantity should be updated. If there is narrow range for your stops and targets and this happens all in quick succession then there is higher likelihood of this.

    What are you using for stop and target submission settings when running the strategy?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hello Ryan,

      There is 8 ticks between the profit target and the stop loss. I clearly see the profit target and stop loss quantities change from 2 to 1 after the partial fill. There are several minutes between the profit target and the stop loss. Everything looks great on the Superdom, as well as the Orders and Executions tab (State= PartFilled).

      Thanks
      Last edited by drachma; 11-17-2010, 01:10 PM.

      Comment


        #4
        We'd have to look at your log and trace files to identify what happened for a particular case. You can mail these with Help > Mail to Support feature. Please let us know the exact time that this occurred and we can take a look.

        What is your setting for Stop and Target Submission?
        • per entry execution
        • By Strategy position.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thank you Ryan,

          I use "Per Entry Execution".
          The log files have been emailed.

          Comment


            #6
            Thanks. We received the files and will review and get back to you. One thing I noticed is it looks like the entry order was partially filled, not the target. Can you confirm if this is what you saw?

            17-Nov-2010 14:52:24|1|32|Order='31463dbf064a409c9e476c30a3f56 059/Replay101' Name='LongZB' New State=PartFilled Instrument='ZB ##-##' Action=Buy Limit price=130.5 Stop price=0 Quantity=2 Type=Limit Filled=1 Fill price=130.5 Error=NoError Native error=''
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi Ryan, the log file contained the info for 2 instruments. The problem occurred with ZB 12-10.
              The entry was definitively filled with quantity 2.
              Before the stop loss was reached, the state was PartFilled. But after the state changed to the following:
              17-Nov-2010 14:52:25|1|32|Order='11b4054ca49c4c9ea9b243815117c 4b4/Replay101' Name='Profit target' New State=PendingCancel Instrument='ZB 12-10' Action=BuyToCover Limit price=130.28125 Stop price=0 Quantity=2 Type=Limit Filled=1 Fill price=130.28125 Error=NoError Native error=''
              I was expecting to see the state of the profit target changed to Cancelled and the state of the stop loss to Filled. But instead it created a new line with the name "Close" and a market order.

              Hopefully this info will help. Thank you

              Comment


                #8
                drachma, I'll consult with Ryan on his findings and then update you. It sounds like NT terminated the strategy as the potential overfill was detected (PendingCancel state for target, while StopLoss filled).
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by andrewtrades, Today, 04:57 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                3 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                7 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X