Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

terminal exit order

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

    terminal exit order

    Hi all,

    I am having a problem with resending exit limit and stop orders (they are cancelled to allow reverse and than resent if the reverse was not successful). I am doing it to follow the order handling rules.

    my orders are ignored with an error:There already is a matching, terminal exit order in place'

    I have checked and I am monitoring and resending the orders only if their status previously has been cancelled.

    when I am back testing there is no problem, just on the simulator. (real time)

    I am attaching all the logs, any insights would be great.

    thx
    Nir
    Attached Files

    #2
    Josh will follow up with you later today. Is this 100% reproducible and can you provide us with a simplified strategy to demonstrate this behaviour?
    RayNinjaTrader Customer Service

    Comment


      #3
      it is 100% reproducible, regarding a simplified strategy, that will take some time, as the fact that I have to manage everything by the code (to avoid the order rules) means that it becomes very complicated.

      it would be great if Jose can have a look on the logs before I am working on simplification... I would be happy to share the strategy fully with Josh directly if required.

      reagrds,
      Nir

      Comment


        #4
        We just took a quick look and what you are running into is current expected behavior. We will review this with NT7 as we do believe it should be changed.

        The problem (internal to NT) is:

        - You submit an exit order
        - You cancel
        - NT has internal tracking of when to ignore orders
        - You resubmit and we currently then ignore it (too complex to explain why)

        With this known limitation, you will have to find a work around or different approach with NT 6.5.
        RayNinjaTrader Customer Service

        Comment


          #5
          Just thinking...

          If possible, use empty string as signal name and see if that circumvents the limitation?
          RayNinjaTrader Customer Service

          Comment


            #6
            thx ray,

            I am not sure I follow your suggestion regarding the empty string for which order the original or the new one?, if I would change the name would it work?

            now this limitation is very disappointing, I would like to refer you to the following thread, I have followed your suggestion on how to achieve this rather simple functionality, and after mastering your advance programming it looks like your suggested solution is not possible. I would appreciate it if you could help me and let me know what the best way to proceed.



            thx
            nir

            Comment


              #7
              When submitting an entry, do not pass in a signal name, just leave it blank, meaning, emptry string.

              EnterLong() vs EnterLong("mySignal"), same goes for exits.

              I can guarantee that this will work, just throwing out an idea that may bypass the road block that you have encountered.

              I surely understand the disapointment of the effort involved only to find out you hit a wall. Unfortunately, this limitation is not a trivial item to change and thus its on our NT7 list.

              I have provided an idea that may work, if not, you will have to take into account this limitation and see if you are able to work around it.
              RayNinjaTrader Customer Service

              Comment


                #8
                I have multiple entry and exits (i.e. 1,2,3,4) to enable scale out.

                if I will not reference the entry the exit will not work properly.

                so to make things clear let me ask a question again:

                is it possible with ninja to get into position, send 1 stop and several limits (to enable scale out) and than as required to reverse via a limit order when you have an opposite signal?

                by now I am already an "advanced programmer" on your platform so help me by providing an approach, that would not hit a wall with hidden internal logic of the current version (which is not documented and so far not explained).

                thx,
                Nir

                Comment


                  #9
                  As you have asked --> Yes.

                  However, based on what I know --> No, since what you can't do is re-submit the cancelled exit order.

                  What you likely could is when your reverse condition is true, monitor the market to see if the limit price is touched, then cancel the stop, wait for confirmation and send market order to enter.

                  I can't guarantee that this gets around the problem but it would be another approach to try.
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    OK, played around and got some progress, but got another wall to workaround.

                    I figured out that I do not need to cancel the exit orders before trying to flatten the position in prep for reversal, so the resubmit of the exit/stop is not a problem any more....

                    however, I am getting the same error when I am trying to close the open position with a limit order. (first try to close work fine, however if the first try did not executed (i.e. price did not match), the exit order is cancelled at the end of the bar, than if another reversal signal happens, and I try to close the position I am getting the terminal exit order already....

                    again it happns only with the sim and not with backtest.

                    if you could explain the internal logic that you are using to not realy cancel the orders it might help to find a workaround, market monitoring is not an option.

                    does the same problem will happen if I am flat trying to go into a position with limit order, price did not match, order cancelled, than trying to go again into position and getting this error??? if yes it is a real basic functionality limitation which means it is impossible to work with entry limit orders in your platform.

                    maybe I am naive, but I spent too much time in learning this platform and migrating my strategy from TS, to declare a defeat, please explain what the logic is, it might help to find a workaround.

                    thx Nir

                    Comment


                      #11
                      To explain anything, I would need a simplified strategy that demonstrates this new limitation that works in backtest but not in real-time. Logic should be the same in both situations and I would need to investigate this further.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        The attached code is a very simplified version of my code (no exit, stops, money management and time management), however it still showing the same limitation.

                        To best understand the problem please run first in back test, you will see that the system is able to try a reversal (i.e. close open position) and if failed as price did not match the system will cancel the order at the end of the bar. If the same signal repeat latter the system will try again, until successful close of position and re-entry on the opposite side.

                        However if you will run the same code with connection to the simulator, you will see that the first try to close the position will work, however the second try will not be sent and a terminal exit order error is generated on the output window.

                        If you have any questions I am happy to explain further, I have tried different combination of exit orders (one or two orders, separate from entry, with names without names all giving exactly the same error).

                        Hope you could explain the problem and help with a work around. (market orders is not an option, it has to be limit).

                        I have sent the code also to Josh per his email.

                        Thanks for your support,
                        Nir
                        Attached Files

                        Comment


                          #13
                          Thanks, we will take a look at this overnight.
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            First off, a problem with your code is that it is violating an Internal Order Handling Rules somewhere. Even in backtesting you can see the Control Center log being printed.

                            I was not able to find any print out where an order was rejected via price not matching in my backtest on the ES.

                            This is the behavior I am seeing live though. Entered long 1 position, sell = cancelled via expiration, sell sent again = ignored because already existing terminal exit order. This is where you are finding problems correct?

                            I suggest in the meantime you use the liveUntilCancelled bool for your exit orders. This way you won't run into the cancelled order at the end of the bar and don't have a need to resubmit unless you want to modify the exit price.
                            Last edited by NinjaTrader_JoshP; 07-29-2008, 02:09 AM.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              thx Josh,

                              regarding the Internal Order Handling Rules, I have notice this myself, but you have to remember that the strategy which I sent you was created just to demonstrate the problem with the terminal exit, it is not the strategy that I am using therefore did not look into this problem.

                              I can assure you that the real strategy has no problem in that respect.

                              you are right about the definition of the problem and I am happy that you manage to recreate the problem in your environment.

                              your suggestion will not help me as the logic of my strategy is reversal and only on that bar, if not filled/touched I would like the original direction/trade management to continue. just as it is programmed in the sample.

                              could you please explain what am I doing wrong? or why your system rejecting my orders?

                              following your line of thinking, would it work to have the reverse/close order until cancelled, and than change/modify the price to outside me bracket just to keep it there instead of cancel? it is more risky as I don't want to have unnecessary live orders in the market, but might be a work around for your limitation/bug. any thoughts on this?

                              any help on this show stopper would be great.

                              regards,
                              Nir

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              630 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              364 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              565 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              568 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X