Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit order not being executed

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

    Exit order not being executed

    Playing with a simple exit system and using strategy builder, the strategy is not exiting on what appears to be the correct code write-up. Apparently I'm doing something wrong?

    Conditions:
    1. A long entry has been fired and is moving in the desired direction.
    2. The long entry has a unique signal name (Long1).
    3. An exit set ( If All) has been created and has two simple conditions:
    a) Position.MarketPosition = MarketPosition.Long
    b) Position.GetUnrealizedProfitLoss(PerformanceUnit.T icks,ES 06-22 (1 Tick)(0)) > 30

    4. On achieving the above, the system fails to exit. And yes, I am calling the signal name correctly in the exit order...
    In appearance it should exit on the 31st tick for sure...

    Where am I going wrong?
    Thanx

    #2
    Stand down on this... Bid/Ask is likely the culprit. Will investigate and report back...

    Comment


      #3
      Question: In using the target & stop systems inside the builder, what specific type of order is used (?) i.e. limit order, stop limit order, etc...

      Comment


        #4
        Hello johnMoss,

        Thanks for your note.

        SetProfitTarget() will submit a Limit order. SetStopLoss() will submit a Stop Market order. SetTrailStop() will submit a Stop Market order.

        This could be seen by running a strategy that calls these order methods and noting the Log tab of the Control Center when an order is submitted to see what the "Type" of the order is. For example, when SetStopLoss() places an order, we see Type = Stop Market in the Log tab of the Control Center.

        Let us know if we may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Thank you for your response. I'm zeroing in on my objective and almost there. What's going on is I do have static stop & target settings well away from the initial entry. I have no problems on the stop side getting out sooner than the public stop, yet the target side does not work accordingly. If you go back and look at my initial post above, I have set a condition such that if an unrealized tick target has been met or exceeded, I initially tried a simple market exit, but it failed. I have one specific instance I am looking at on my screen. An entry was made, the 30 tick condition was satisfied, yet it did not exit. In fact price traveled to 34 ticks in favor. In visual test, I reset the the "public target", meaning the target setting in the Targets and Stops window, to 30 ticks and it indeed exited just fine.

          In essence here I am wanting to create an identical condition to the built-in target method so that if met it exits where I am asking it to. [This is a conditionally based exit is why...]

          In following your instruction, I did see in the Log window that the exit method was ignored due to Internal Order Handling Rules. I gather thus that the only order method allowed will be a market order OCO exit if a limit order target already exists for the unique entry?

          Again that was my initial method and it failed. Note however that total tick travel was 34 ticks in favor. I did see that if the simple exit long (market) was set to fire at 25 ticks, it worked. Specifically up to 27 ticks it worked...

          Comment


            #6
            Lol... I've answered my own question. You can't have a sim & static at the same time. I know what to do now, assumedly change my set targets to simulated?

            Comment


              #7
              Hello johnMoss,

              Thanks for your note.

              "I did see in the Log window that the exit method was ignored due to Internal Order Handling Rules"

              This message indicates that the strategy placed an order that was ignored because it went against the Managed Approach Internal Order Handling Rules.

              See this help guide page for information about Managed Approach Internal Order Handling Rules: https://ninjatrader.com/support/help...antedPositions

              Ultimately, prints would need to be added to the script to understand how the strategy is processing logic and placing orders. TraceOrders should also be enabled which will let you know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

              Below is a link to a forum post that demonstrates how to use prints to understand behavior.
              https://ninjatrader.com/support/foru...121#post791121

              Please let me know if I may further assist
              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              66 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              141 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              76 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              47 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              51 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X