Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with NT restrictions

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

    Problem with NT restrictions

    Hello everybody,

    I'm translating into Ninja Trader 7 a strategy that I used to run on MultiCharts, but I have a problem with NT order restrictions.

    Specifically, my problem is that when the strategy opens a position (for example a long one) it generates the following orders (in this order):
    - An enterShortStop order to reverse the position
    - An exitLongLimit to close de current position (stopProfit)

    This works fine in Multicharts, but it seems that it doesn't in NT since I can't send a Profit Order to exit a position when there is active another order to open positions in the opposite direction. The Help Guide says: "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"

    Knowing this, I thought that a good solution would be to change the enterShortStop order to a exitLongStop and use the method OnExecute to throw the enterShortStop when the exitLongStop is executed, but the problem is that (on backtesting at least), the event OnExecute is only triggered at the end of the current bar, so it throws the order (the enterShortStop) in the next bar, and I need the strategy to throw it exactly at the same time that the execution of the exitLongStop.

    Is there any posibility to do this? How?

    Thanks in advance. Regards.

    #2
    Hello sagoga69,

    Welcome to the NinjaTrader forums!

    The internal order handling rules you're running into are part of the managed order system, so you may consider moving to an unmanaged one. An unmanaged strategy has none of the internal rules or order management. The only three methods you use are SubmitOrder(), ChangeOrder(), and CancelOrder(). Your stop order would be submitted at one half the quantity of your limit order, which you plan to use as reversal.


    Additional info on unmanaged NinjaScript strategies is available here:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your welcome Ryan and for your quick answer,

      Your suggestions help me a lot, but I have several problems with the unmaged approach. Since they are about another matter, I'm going to post a new thread.

      Thanks again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      666 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      376 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X