Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble understanding the Internal (interal?) Order Handling

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

    Trouble understanding the Internal (interal?) Order Handling

    Could someone please help me understand about NT's Internal Order Handling?

    I've been programming using ATM Strategies and OIFs. Now I wish to backtest more, so I'm attempting to re-program my ideas using EnterLimitStop(), etc. for entries.

    My strategies deal with entering several order at the beginning of the day, to be very short-lived and everything exited before the day ends. There are many, many orders which will never be hit, because the market never gets up to (or down to) that particular entry. This works very well using ATM Strategies via code and manually entering them in Charts or SuperDoms.

    I am having troubles with orders being ignored (i.e. Log entries saying "An Enter() method to submit an entry order ... has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.")

    Sadly, I am only attempting to do what I successfully do manually using ATM Strategies: Many Stop Entries above and below the morning price, to be executed when the Stop is triggered. Enter() methods seem to be seeing that there are orders on the other side, and cancelling them.

    Based on using AAPLHere's a code snippet:

    ... Initialize()
    CalculateOnBarClose = false;
    EntryHandling = EntryHandling.UniqueEntries;
    EntriesPerDirection = 15;

    ... OnBarUpdate()
    EnterShortLimit(0, true, 2, 98.00, "Two-Leg1...01");

    EnterLongStopLimit(0, true, 2, 102.20, 102.42, "Two-Leg1...02");



    These have two separate Signal Names, but I only get the initial Short order showing a State. The Long order in this example, receives the Log error I'd mentioned before.

    What am I not getting?


    Thanks,

    Brian1

    #2
    Hi Brian1,

    NinjaTrader's internal order handling rules are discussed here - http://www.ninjatrader-support.com/H...verview36.html

    They were implemented to reduce unwanted positions in a fast real time trading environment.

    Comment


      #3
      Bertrand, I know this well. Could you please respond to my question?

      Why does this work manually, but not via code? I would expect the opposite - that you can do more in code than via your GUI.

      If someone would kindly look at the code, maybe they could see something that I am not. Should this be that entering a Short Limit order AND a Long StopLimit order be cancelling like it is? What could I possibly be doing wrong?

      Please respond,

      Brian1
      Last edited by Brian1; 02-10-2009, 09:26 AM.

      Comment


        #4
        Brian1, unfortunately there is no other workaround as putting both in separate strategies, otherwise you would run into the 'Internal Order Handling' procedures.

        Comment


          #5
          Thanks for the reply. I have a few questions still?

          1) Do you have any thoughts on why I am able to do this using the Chart or SuperDom entries? It is very easy (thankfully) to enter a Short Limit order above the market price, and also enter a Long Limit order below the market price. Do you think that NinjaTrade will take this ability away at some point in the future, realizing that it violates the "Internal Order Handling" procedures. I need to make certain that NT is going to do what I need. Again, it does it in the Charts and SuperDom entries, very nicely.

          2) I've used OIFs for ATM Strategies to do this as well. However, because I am unable to Backtest using ATM Strategies, I must now code my strategies to do backtesting. Do you think I can use OIF orders WITHOUT ATM Strategies (i.e. leaving that field blank) and still have orders above and below the current market price?

          (Remember these are all ORDERS. They are NOT TRADES or POSITIONS above and below ... but simply orders.)

          3) Oh, one more question: I'd been told that NT v7 will have ATM Strategy backtesting. Is this still in the plans?

          Thanks,

          Brian1

          Comment


            #6
            Hi,

            1. No I am not aware of a change in this regard. For automatic strategies, you can use separate strategies to accomplish this.

            2. Yes, the ATM strategy field is an optional value in the OIF files - http://www.ninjatrader-support.com/H...nFilesOIF.html

            3. You can manually code out the ATM strategies behavior for backtesting, NinjaTrader 7 feature announcements will be made when available - thanks for your understanding.

            Comment


              #7
              Thank you Bertrand, for your responses.

              Please note that answer #3 is exactly what I am asking to do. Because of NT's "Internal Order Handling" procedures, one actually is prevented from writing code to backtest something that can be accomplished using an ATM Strategy.

              It's a Catch-22:
              (a) I cannot backtest ATM Strategies. So I'm encouraged to write code to do that.
              (b) If I try to write code to build a backtestable strategy without use of ATM Strategies, I receive errors saying I cannot place Enter() orders above and below the current price. Something that ATM Strategies allow me to do (and that I need to do).

              Are you seeing the issue here? Could I please discuss this with a developer or manager? This matters greatly to me.

              Thank you,

              Brian1
              Last edited by Brian1; 02-10-2009, 09:20 PM.

              Comment


                #8
                Brian, You have to write the code so that you avoid violating the order handling rules.
                If this is just for backtesting, then I think your strategy needs to wait until the market price reaches your entry price, then place the order. To use it for real trading you may want your order placed earlier, in which case your strategy would place the order only when price is a certain distance from your planned entry price, then cancel it if price moves away and gets close to another order entry point.
                I hope that makes sense.

                Comment


                  #9
                  Thanks for your input MJT.

                  Not sure I follow Brian, you should be able to code out ATM strategies for backtesting as those would (if for example long) place exit orders above the market and a stop for protection below.

                  Comment


                    #10
                    Hey thanks MJT. Much appreciated.

                    Writing it that way is my long term intent. I just thought I'd be able to more quickly backtest my theories. ATM Strategy has worked great for forward testing, but doesn't allow backtesting at this time.

                    So ... I guess I've got my work cut out for me.

                    Thanks to both of you.

                    Brian1

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    647 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    368 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
                    571 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