Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLongStop

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

    ExitLongStop

    Hi All,

    I have the following error on back testing on my code.

    **NT** An Exit() method to submit an exit order at '04-01-2011 10:15:00 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

    The problem is stop loss order not executing on backtesting.

    The following entryorders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss and SetProfitTarget for profit.

    I would like to know how we can come out of this situation?

    Antony

    #2
    Hello,

    This issue is likley coming from using SetProfitTarget when using ExitLongStop. Please review our Order Handling Rules:



    Methods that generate orders to exit a position will be ignored if:
    •A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
    A position is open and an order submitted by a set method (SetStopLoss() for example) is active
    SetStopLoss() is just used an example, however SetProfitTarget() can trigger this violation as well. You will need to use another Exit method for your profit target, or use both SetStopLoss and SetProfitTarget together (which will be inheritancely OCO used togther)
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by Antony View Post
      Hi All,

      I have the following error on back testing on my code.

      **NT** An Exit() method to submit an exit order at '04-01-2011 10:15:00 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

      The problem is stop loss order not executing on backtesting.

      The following entryorders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss and SetProfitTarget for profit.

      I would like to know how we can come out of this situation?

      Antony
      Hi All,

      I have the following error on back testing on my code.

      The problem is stop loss order not executing on backtesting.

      The following entry orders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss.

      If entry and exit condition satisfied on same bar then entry order executed. But exit order not executed.

      I would like to know how we can come out of this situation?

      Antony

      Comment


        #4
        Hi Antony, as Matthew posted you're running into the order handling rules here - please try abandon the one Set() method in your setup and work directly with an ExitLongLimit for example for the Long target, if needed you could cancel order this then directly and issue your other order, this would then not get caught in the order handling rules, for explicit order cancellation using IOrders, please see this link :

        Comment


          #5
          Entry and exit on same bar

          If entry is taken on a bar and the same bar target or stoploss reached, but exit orders not executed. I can use only ExitLongLimit and ExitLongStop.

          Any suggestion?, Sample Code?

          if (Position.MarketPosition == MarketPosition.Flat)
          {
          EnterLong(1, "");
          justLEntered = true;
          }
          if (Position.MarketPosition == MarketPosition.Long && justLEntered == true)
          {
          LStopV = Position.AvgPrice - (initialStop*0.25);
          justLEntered = false;
          }

          if (Position.MarketPosition == MarketPosition. Long)
          {
          If (LStopV > 0) ExitLongStop(LStopV);
          }

          Error message is

          **NT** A Sell stop order placed at '10-08-2011 9:00:00 AM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

          Here long entry taken at open of the bar and the same bar price has broken the stoploss.

          Any error on code?

          Please Help…

          Antony



          Thanks,

          Antony.
          Last edited by Antony; 10-12-2011, 11:58 AM. Reason: need more help

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            Hi Antony, as Matthew posted you're running into the order handling rules here - please try abandon the one Set() method in your setup and work directly with an ExitLongLimit for example for the Long target, if needed you could cancel order this then directly and issue your other order, this would then not get caught in the order handling rules, for explicit order cancellation using IOrders, please see this link :

            http://www.ninjatrader.com/support/h...ancelorder.htm
            Such a very amazing link!
            __________________
            Watch The Big Year Movie Online Free
            Last edited by emmahudson88; 10-13-2011, 03:32 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            629 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            564 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X