Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

order conflicts

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

    order conflicts

    I am trying to code a strategy that uses a limit entry, a limit exit, and a protective stop. NT will not execute the limit exits unless I remove the protective stop. I thought it might by some mistake in my code, so I tried using wizard-generated code to see what I'm doing wrong, but got the same result. I tried using very simple conditions in the wizard:

    condition 1 (entry):
    fast EMA > slow EMA
    close < fast EMA
    enter long on limit at low

    condition 2 (exit):
    high > last 20 highs
    exit long on limit at high

    stoploss: 12 ticks

    The exit limits are ignored. If I remove the stoploss, then the exit limit orders do execute. Of course I need the stoploss and profit exit both to work. I have read the helpguide info about internal order handling at http://www.ninjatrader-support.com/H...tml?Overview36, but I don't see the cause of my problem.

    What am I doing wrong?

    #2
    Methods that generate orders to exit a position will be ignored if a strategy position is open and:
    • An order submitted by a set method (SetStopLoss() for example) is active
    Reason: Very possible that both your exit position and your Set() method to try to close the same position at the same time. If both get filled then you are left with an undesirable overfill. This is why it is not allowed. If you want a stop loss, use ExitLongStop() instead of the Set() methods when mixing with explicit exit orders.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      wizard generates wrong stop-loss

      Isn't the wizard smart enough to use the correct type of stop-loss order? That's a pretty major flaw if the wizard can't generate the proper code for a simple limit entry, profit limit exit, and static stop-loss. Trading 101 here...

      How do I trick the wizard into writing the proper stop-loss?

      Comment


        #4
        Not following you. There is no "flaw" here. You need to submit the proper order. If you want a stop loss along with an explicit exit limit, just submit it as exit stop.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          strategy wizard code, not mine!

          If I was programming my own code, then I should be concerned with submitting the proper order. If the wizard is generating the code, then the wizard should submit the proper order. In this case the wizard dialog says, "Enter optional stoploss and profit targets for your strategy here," and so I did.

          It is not reasonable to expect new users to know, or to find out by trial and error, that a stoploss entered where the wizard offers a stoploss will sabotage their strategy. A simple one-line warning in the wizard could have saved me 50 hours of work!)(*&@#!#(*$&

          I suggest that at least you should add something like this to the "stops and targets" page of the wizard:
          "WARNING: Do not enter your stoploss on the 'Stops and Targets' page if you have entered profit targets on the tabs of the 'Conditions and Actions' page. Use this page only if both stops and targets will be entered from this page, otherwise enter both stops and targets on the previous page."

          Comment


            #6
            Thank you for the suggestion. We will put it on our list of future considerations.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X