Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Standing orders getting canceled.

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

    Standing orders getting canceled.

    I took the sample code and added a couple of targets and set a BE stop once the first target was hit. For whatever reason, when this silly sample strat hits the second profit target it exits it cancels out the current standing orders but leaves an open position. I have no idea why or how to fix this. Any help would be most appreciated.

    Ran on NQ 1 minute chart.

    See attached:
    SampleOnOrderUpdate.cs
    Attached Files

    #2
    Hello ZeroKuhl,

    Are you trying to scale out? If so you need to submit unique entries in order to scale out the exit. For example if you want 3 exits for 3 quantity you should have 3 entries.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello ZeroKuhl,

      Are you trying to scale out? If so you need to submit unique entries in order to scale out the exit. For example, if you want 3 exits for 3 quantity you should have 3 entries.
      The original order was for 3 contracts. I am trying to have multiple profit targets to scale out by one contract and move the stop to BE after it hits the first target. That works. But when the second target gets hit then it takes profit and cancels the thrid target. Leaving an unprotected open position.

      So are you saying I need separate entry orders for every profit target?

      Like this?

      EnterLong(1,"MyEntry1");
      EnterLong(1,"MyEntry2");
      EnterLong(1,"MyEntry3");

      Comment


        #4
        Hello ZeroKuhl,

        Yes if you are trying to scale out you should have 3 entries with unique signal names. That breaks the position up into portions which you can control with targets.

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello ZeroKuhl,

          Yes if you are trying to scale out you should have 3 entries with unique signal names. That breaks the position up into portions which you can control with targets.
          Seems like a very unfortunate way of doing things requiring a lot of code duplication. Do you guys have any example code with multiple targets as previously described? Also, I assume that I will need separate stop orders for each entry as well?

          Would there be any benefit from doing an unmanaged approach for this case?

          Comment


            #6
            Hello ZeroKuhl,

            To submit multiple targets you would send multiple SetProfitTarget methods.



            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Was my understanding that you should not mix the two order type functions Sets and Exits. The attached code was based on an example NT staff have reposted numerous times.

              So if we are supposed to use SetProfitTarget as you suggested then what is the point of having the profit targets in the OnExecutionUpdate function from the NT example code?

              Comment


                #8
                Hello ZeroKuhl,

                I am unsure what the sample you provided was targeted for in your previous correspondence. To make a strategy that submits multiple orders and also scales out would require using multiple entries.

                Comment


                  #9
                  Originally posted by NinjaTrader_Jesse View Post
                  Hello ZeroKuhl,

                  I am unsure what the sample you provided was targeted for in your previous correspondence. To make a strategy that submits multiple orders and also scales out would require using multiple entries.
                  Your suggestion made everything worse. The hunt for a solution continues.

                  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
                  75 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  46 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