Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Another Internal Order Handling Rules that Reduce Unwanted Positions Question

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

    Another Internal Order Handling Rules that Reduce Unwanted Positions Question

    Hello,

    I looked at the rules for "Internal Order Handling Rules that Reduce Unwanted Positions", but was not able to explain the error I received.

    I entered my position with: EnterLongLimit(LotSize, Bars.GetClose(CurrentBar), "Long");

    and when I tried to exit my position with: ExitLongLimit(Bars.GetClose(CurrentBar), "ExitLong", "Long");

    I get the errors: "2/8/2023 8:19:32 AM Strategy 'AGG6BarDailyMonthlyDrawdownLive3001Test/89041889': Ignored SubmitOrderManaged() method at 2/8/2023 8:19:32 AM: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0 LimitPrice=4153.00 StopPrice=0 SignalName='ExitLong' FromEntrySignal='Long' Reason='An Exit() method to submit an exit order has been ignored. Please search on the term 'Internal Order Handling Rules that Reduce Unwanted Positions' in the Help Guide for detailed explanation.'
    Strategy 'AGG6BarDailyMonthlyDrawdownLive3001Test/89041889': An Exit() method to submit an exit order at '2/8/2023 8:19:31 AM' has been ignored. Please search on the term 'Internal Order Handling Rules that Reduce Unwanted Positions' in the Help Guide for detailed explanation.​"

    In addition, I set both the profit target and stop loss only ONCE in the OnStateChange(), see below:

    else if (State == State.Configure)
    {
    SetProfitTarget(CalculationMode.Ticks, profitTarget);
    SetStopLoss(CalculationMode.Ticks, hardDeck);
    }

    Kindly advise what rule did I violate to have caused the error?

    Best regards,

    Billy

    #2
    You are not allowed to use Exit methods along with Set methods.

    Comment


      #3
      Hello Billy,

      KonstantinosNT is correct. From the help guide:
      "Methods that generate orders to exit a position will be ignored if:
      ...
      • A position is open and an order submitted by a set method (SetStopLoss() for example) is active"


      Choose one or the other. You can submit your own stop order with ExitLongStopMarket() to go with your ExitLongLimit().
      Below are links to examples.

      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you Chelsea and Konstantinos, for the explanation.

        Comment


          #5
          Just a point of clarification for those landing on this page. The help guide on "Rules that Reduce Unwanted Positions" says

          Click image for larger version

Name:	image.png
Views:	438
Size:	2.7 KB
ID:	1282435

          So you can use ExitLong() or ExitShort() along with Set methods.
          Steve L
          NinjaTrader Ecosystem Vendor - Ninja Mastery

          Comment


            #6
            Hello Steve L,

            That is the case. The user billythekid72, however, is using ExitLongLimit().
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CaptainJack, 05-29-2026, 05:09 AM
            0 responses
            171 views
            0 likes
            Last Post CaptainJack  
            Started by CaptainJack, 05-29-2026, 12:02 AM
            0 responses
            88 views
            0 likes
            Last Post CaptainJack  
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            128 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            208 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            185 views
            0 likes
            Last Post CarlTrading  
            Working...
            X