Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss Order not placed

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

    Stop Loss Order not placed

    Hi,
    I tested the following code in the strategy tester, and it did fine.
    Running on a simulation account in real market, the SetStopLoss is not triggered and is being rejected.

    SetProfitTarget("buyOrder", CalculationMode.Pips, BoxSize * ProfitFactor);
    SetStopLoss("buyOrder", CalculationMode.Pips, BoxSize, false);
    EnterLong(DefaultQuantity,"buyOrder");

    The log results in the following error.
    10.02.2025 11:55:30 Default Strategy 'BoxTradingStrategyDS/340536570': An Set() method to submit an exit order at '02/10/2025 00:01:00' has been ignored. Please search on the term 'Internal Order Handling Rules that Reduce Unwanted Positions' in the Help Guide for detailed explanation.


    This is the documentation I found, but it doesn't describe any problem I would have.

    The following rules are true per unique signal name:



    Methods that generate orders to enter a position will be ignored if:

    •A position is open and an order submitted by a non market order exit method (ExitLongLimit() 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 and the order is used to open a position in the opposite direction

    •A position is open and two or more Entry methods to reverse the position are entered together. In this case the second Entry order will be ignored.

    •The strategy position is flat 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

    •The entry signal name is not unique



    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



    Set() 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 non market order exit method (ExitLongLimit() for example) is active

    Where could the bug be?
    Thanks and best
    Szymon

    Last edited by moneymaster; 02-10-2025, 07:17 AM.

    #2
    Hello moneymaster,

    Thank you for your post.

    This error message indicates that an order was ignored because your strategy violates the Managed Approach Internal Order Handling Rules​.

    The following would be one of the reasons why:

    •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 non market order exit method (ExitLongLimit() for example) is active


    If you are not sure why you're hitting this error, I recommend debugging by enabling TraceOrders. TraceOrders will output to the NinjaScript Output window a message when orders are being submitted, ignored, cancelled, or rejected.

    TraceOrders - https://ninjatrader.com/support/help...raceorders.htm

    Comment


      #3
      Hi Gaby,

      the problem was that in the strategy the setting "synchronize account" was not activated.

      Thanks and best regards

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      61 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      40 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      21 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      23 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X