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:	418
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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            63 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            139 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X