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:	431
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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            90 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            135 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            119 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            69 views
            0 likes
            Last Post PaulMohn  
            Working...
            X