Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

order management

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

    order management

    so I am a little confused on how nt manages orders... so by default is a EnterShortLimit() function an atm function? am i able to cancel/change that order without atm? if so can you please direct me?

    #2
    nightriderx,

    No, EnterShortLimit() is a NinjaScript order method. All Atm methods start with Atm or GetAtm.

    To change the order, just resubmit using all the same parameters except a new price. This sample can help work with CancelOrder() which requires IOrder structure:
    When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      thanks Ryan.
      I am a little confused about one part of the order management.
      if I am long 1 position and then want to sell 2...why does NT first close my long and then shorts 2 (leaving me short 2)? ...is there a way to turn that feature off such that it does not close the long (just leaves me short 1)?
      thanks!

      Comment


        #4
        That's the behavior for enter methods - They'll reverse by closing the existing position and opening in the other direction.

        If you don't want this behavior, add a market position check to your entries.

        if (Position.MarketPostion == MarketPosition.Flat)
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          right, so for me to reverse, I have to place 2 orders? one to close and one to reverse...?

          there must be a way to do so with just 1 order...

          Comment


            #6
            Originally posted by nightriderx View Post
            right, so for me to reverse, I have to place 2 orders? one to close and one to reverse...?

            there must be a way to do so with just 1 order...
            Only if you use Market Orders.

            Comment


              #7
              Enter methods will reverse. All enter methods, including stop, limit, and stop limit will reverse a position.

              If you want it in one operation rather than two, you would have to move to an unmanaged approach.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by koganam View Post
                Only if you use Market Orders.
                This is incorrect. All enter methods will reverse a position.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  perfect. thanks!

                  Comment


                    #10
                    Originally posted by NinjaTrader_RyanM View Post
                    This is incorrect. All enter methods will reverse a position.
                    Do you perhaps mean "if the positions are not protected by any Stop orders?" If position reversal can occur all willy-nilly, what has been the point of the numerous threads such as these, where I, and multiple others have raised this issue?







                    For those bold folks that trade unprotected positions, I will remind you of the old Wall Street maxim: “There are bold traders and there are old traders, but there are no bold, old traders.”

                    Bold traders trade without stops. After blowing out an account, I have learned to not be bold; I would rather be old.

                    Comment


                      #11
                      Koganam,

                      Internal order handling rules don't apply to market orders. This does not mean that the reversal behavior in market orders is any different than the other order methods. The posts you reference point to difficulties understanding internal order handling rules, and not issues with reversal mechanics in limit, stoplimit, and stop orders.

                      If the internal order handling rules prevent you from achieving your order submission goals, this is exactly why we have unmanaged strategies.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_RyanM View Post
                        Koganam,

                        Internal order handling rules don't apply to market orders. This does not mean that the reversal behavior in market orders is any different than the other order methods. The posts you reference point to difficulties understanding internal order handling rules, and not issues with reversal mechanics in limit, stoplimit, and stop orders.

                        If the internal order handling rules prevent you from achieving your order submission goals, this is exactly why we have unmanaged strategies.
                        So are you then confirming that reversal mechanics, while the same across all order types, are only valid for unprotected positions. Basically stop-and-reverse systems?

                        As limit orders are not guaranteed to be filled; and are especially unlikely to be filled in a fast moving market, which is where one would most likely need to reverse quickly, using limit orders in stop-and-reverse systems is even worse than using market orders.

                        Comment


                          #13
                          No, I'm saying that the cases you've shown are a misunderstanding of internal order handling rules, and the frequent comments to the affect that "limit orders do not reverse" are incorrect.

                          You're presenting individual coding problems as NinjaTrader issues.

                          In a managed system:
                          Cancel the working exit order and submit your entry order for reversal. If you desire a different handling, use an unmanged system.

                          In an unmanaged system:
                          There are no internal rules. Submit, cancel, change however you want.
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_RyanM View Post
                            No, I'm saying that the cases you've shown are a misunderstanding of internal order handling rules, and the frequent comments to the affect that "limit orders do not reverse" are incorrect.

                            You're presenting individual coding problems as NinjaTrader issues.

                            In a managed system:
                            Cancel the working exit order and submit your entry order for reversal. If you desire a different handling, use an unmanged system.

                            In an unmanaged system:
                            There are no internal rules. Submit, cancel, change however you want.
                            With all due respect to you as vendor of the product, what you are doing now is trying to confound issues because you are unwilling to admit that there are limitations to your product. All the more surprising as your answer above actually admits to the limitation, and even to the fact that you have provided an "unmanaged" option to handle that limitation.

                            As a user of a closed framework, the only thing that interests me is the results of what the internals provide: I could care less why. And what Ninja Trader provides (whatever the reasoning about the internal management rules), is the INABILITY to reverse on a SINGLE candle if one is using a protected order. I am pretty sure that I understand the internal rules just fine, unless you are implying that I either cannot understand English, or your documents are not explaining the rules correctly.

                            The inability to reverse on a single candle in a managed order entry is a DIRECT result of the internal rules. As a result of those rules, one cannot reverse on a single candle unless the position is unprotected. No matter how much you try to obfuscate the issue with your verbal gymnastics, that is simply how it is. Admit it and let us get on: If you have a position with no protective stop, any reversal order will reverse you: if you have a protective stop, then you can only exit and enter on the next candle, but you cannot reverse directly ON THE SAME candle. THAT is the ONLY issue.

                            I am done, because my next response will not be polite. Kindly refrain from ever again insulting me with a statement such as this one: "You're presenting individual coding problems as NinjaTrader issues." I do not have a coding issue: in fact, I have coded around this limitation using a switch to CalculateOnBarClose and OnOrderUpdate(), in a convoluted fashion so as to let me reverse on a single candle in managed mode. I could not have done that if I am such an incompetent coder. Does all the code that I have placed in this forum in answer to user's questions, really leave you thinking that I am incompetent?
                            Last edited by koganam; 06-23-2011, 06:29 PM.

                            Comment


                              #15
                              Koganam,

                              I appreciate your contribution here and never meant to offend. I feel this issue still needs more clarification.

                              INABILITY to reverse on a SINGLE candle if one is using a protected order. I
                              This is simply not true. There is no limitation that prevents cancelling a working order and submitting a reveral order within the same bar. This may be true historically but not as far as operation of a live strategy. In fact, I sent to you a strategy that does exactly this and works as efficiently as possible to send the reversal order as soon as the exit order is cancelled. It also sounds like you have coded your own solution to this which is great.

                              The internal order handling rules are not a limitation but are part of the design of our managed framework. We recognize some would prefer a different handling and provide an option for that.
                              Attached Files
                              Last edited by NinjaTrader_RyanM1; 06-24-2011, 10:08 AM.
                              Ryan M.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              648 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              572 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              573 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X