Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose Order Rejected

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

    ExitOnClose Order Rejected

    Hi

    I'm trying to understand why the order produced by ExitOnClose was rejected. I would like suggestions for what I should investigate.

    The strategy opened a short position with EnterShortStop().
    Take profit and Stop loss orders were placed after entry fill.
    ExitOnClose = true and ExitOnCloseSeconds = 660 (11 mintues).
    The normal exits have been working fine.
    ExitOnClose has tested OK on a demo account, but this is the first time ExitOnClose was required to close the position on a live account.

    In this case the error stated "The order type is not allowed for the commodity affected Order" BuyToCover 1 Market"
    However, the stop loss and take profit executions are also BuyToCover and work fine.

    The account is with AMP / CQG.
    PC time is set to New Zealand local time.

    Cheers
    Tony

    Here is a section of the log:
    13/09/2012 7:49:00|1|128|Exit on close handling for strategy 'Gap11' started. 13/09/2012 7:49:00|1|32|Order='1923921760/86497!AMP!ac86497' Name='Profit target' New state=PendingCancel Instrument='TF 09-12' Action=BuyToCover Limit price=838.2 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='1923921761/86497!AMP!ac86497' Name='Stop loss' New state=PendingCancel Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=846.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='2cd16e0faa39460e9051079c3d19df 28/86497!AMP!ac86497' Name='Exit on close' New state=PendingSubmit Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='2cd16e0faa39460e9051079c3d19df 28/86497!AMP!ac86497' Name='Exit on close' New state=Rejected Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=OrderRejected Native error='The order type is not allowed for the commodity' 13/09/2012 7:49:00|0|32|AMP Live, The order type is not allowed for the commodity affected Order: BuyToCover 1 Market 13/09/2012 7:49:00|0|128|Strategy 'Gap11/cd7055f2e7e749b88edcb152c9347629' submitted an order that generated the following error 'OrderRejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself. 13/09/2012 7:49:00|1|32|Order='1923921760/86497!AMP!ac86497' Name='Profit target' New state=Cancelled Instrument='TF 09-12' Action=BuyToCover Limit price=838.2 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='1923921761/86497!AMP!ac86497' Name='Stop loss' New state=Cancelled Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=846.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='6322db98c24042799b6ed63707aca5 8f/86497!AMP!ac86497' Name='Close' New state=PendingSubmit Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error='' 13/09/2012 7:49:00|1|32|Order='6322db98c24042799b6ed63707aca5 8f/86497!AMP!ac86497' Name='Close' New state=Rejected Instrument='TF 09-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=OrderRejected Native error='The order type is not allowed for the commodity' 13/09/2012 7:49:00|0|32|AMP Live, The order type is not allowed for the commodity affected Order: BuyToCover 1 Market 13/09/2012 7:49:00|1|128|Disabling NinjaScript strategy 'Gap11/cd7055f2e7e749b88edcb152c9347629'

    #2
    Hi Tony, which TIF setting were you using for this strategy for the market order on TF?

    Comment


      #3
      ExitOnClose Order Rejected

      Hi Bertrand

      TIF in strategy settings is GTC.

      In the strategy code, for a short position:
      Entry order is: EnterShortStop( 0, true, nContracts, entryLevel, entryName ); // GTC, worked OK
      Take profit order is: SetProfitTarget( entryName, CalculationMode.Price, target ); // GTC, I think
      Stop loss order is: SetStopLoss( entryName, CalculationMode.Price, stopLoss, false ); // GTC, I think
      The rejected order was generated by Exit On Close handling. I don't know what TIF is set for this.

      The strategy generated orders seem fine, it's the order generated by the exit on close handling that was rejected for being an order type that is not allowed.

      I hope this helps, but let me know what else I can do.

      Cheers
      Tony

      Comment


        #4
        GTC market orders are not supported on the TF /ICE exchange.

        You will need to set your TIF to DAY at least for the market orders.

        TimeInForce = Cbi.TimeInForce.Day;
        MatthewNinjaTrader Product Management

        Comment


          #5
          ExitOnClose Order Rejected

          Hi Matthew

          These little pieces of information are like gold! Thanks.

          For my further understanding:

          1. At the moment I do not set TimeInForce in the strategy code, but I will. In the meantime, is it OK to set the Time in force = Day in the strategy settings on the chart?
          2. At the moment in the strategy code, the entry orders use liveUntilCancelled = true. I presume I can I leave this as is, because they are not market orders. Right?

          To help me avoid similar issues in the future, where can I find this kind of information without bugging you guys?

          Thanks again.
          Tony

          Comment


            #6
            Yes, setting the TIF manually as strategy parameter would be fine - as an alternative - http://www.ninjatrader.com/support/h...imeinforce.htm

            liveUntilCancelled is fine, with a TIF of DAY those would be cancelled with the session end handling as well.

            We don't feel bugged at all, so just post or email when you need something.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sjsj2732, Yesterday, 04:31 AM
            0 responses
            33 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            286 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            285 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            133 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            91 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X