Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders very slow to execute on Simulator in heavy volume

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

    Orders very slow to execute on Simulator in heavy volume

    Alright, this is basically a follow-up to an issue that I reported a month or so ago... at the time I was running NT on Windows Vista 64, and the support guys told me that my problem was related to that fact, since it was not supported on that OS.

    Since then however, I have completely wiped my PC, installed a clean copy of 32-bit XP Home, and tweaked it to be completely set up for performance (i.e, no extra graphics, indexing disabled, etc.). I have even launched NT as a realtime priority process, and used a CPU affinity program to assign anything else that might be running to one of the other cores on my quad-core CPU (so NT has 3 cores all to itself, not that it's taking advantage of that anyways). I also created a 1 Gig RAM Drive and put my pagefile.sys on there to reduce disk swapping.

    My system is a Core i7 920 with 12 gigs of RAM, although at the moment obviously only 3 Gigs are addressable with a 32 bit OS on there. Currently Windows reports 1 Gig of ram still free with the above-mentioned settings.

    Here is my issue, which occurs with the simulator:

    Whenever the volume is very heavy, the actual processing of trades is usually delayed by a sometimes significant margin. For example, today in heavy volume I pressed the market buy key, and while the Red X appeared immediately in the SuperDOM, the system just hung for about 5 full seconds before I finally heard the "order filled" message - at whatever the price had already spiked to.

    I have the following charts open:

    A 1-minute candle chart with bollinger bands, volume, stochastics, and inverse fisher transform. (CalculateOnBarClose is set to false for volume/stochs/fisher, true for bollinger. The look-back period is set to 100 bars.)

    A 3-minute candle chart with exactly the same settings as above.

    A 4-Range chart with no indicators at all (price only), set to 1-day lookback period.

    A 4-Range chart with 3 moving averages and 3 linear regression lines, set to CalculateOnBarClose = true, lookback period of 1000 bars (around 1 day or so on YM which is what I was trading)

    A 2-Range chart with 2 linear regression lines set to CalcOnBarClose = true, lookback period of 350 bars.

    A 20-second chart with bollinger bands, set to calcOnBarClose = true, simple volume indicator with calcOnBarClose = false, lookback period = 200 bars.

    Time and Sales window (91 rows)

    SuperDOM

    That's it. 6 relatively simple charts, with very small lookback periods, using mostly off-the-shelf indicators, plus one T&S and one DOM... I do have a bit of custom code in an indicator that uses about 4-5 very simple if/then statements in C# to decide which color to paint the bars, but that can't be causing this issue since the processing time for that is negligible.

    Also, my database file is brand-new, as I just renamed the old one this morning - so that's not the issue either. I have set Enforce Immediate Fills in the simulator options section to true, although the issue happens whether that is checked or not.

    This is the most simple setup I can come up with that allows me to trade my style, and basically at the moment NT is making it very hard for me to do that, at least in demo mode.... I need to be sure that when I click the market order button that my order gets sent to the exchange right then, and not after NT is finished doing something else first.

    So here are my questions:

    1. Does the setup I described sound like it should be causing NT this many problems on my machine? (The 6 charts are pretty simple and my CPU is powerful... this shouldn't be happening, no matter what.)

    2. Have you ever heard of a situation where an order can take up to 5 seconds to be placed for real at the exchange, even if the system is overburdened with too many charts? I can't imagine that this would be the case, or else nobody would be using NT.

    3. Is anyone running with a setup that is at least as complicated or more complicated than this, and what is your real-world performance like? How long between the time you click the market order button and the time you hear the confirmation come back, best-case and worst-case? How many charts do you have open, and what type of calculations are being done?

    Even if this is only a demo issue (and I suspect that it probably is), you guys still need to make sure that you fix it, because it makes simulated trading act very differently from real trading during heavy volume periods, if that is the case. (I might also add that it makes your software look very bad to someone who is just trying it out before they place real trades - not everyone is going to go to the lengths I have to figure this out.)

    My main concern obviously is that this doesn't occur during live trading - I would like an answer to this before I attempt to try it out with real trades...

    Thanks!
    Last edited by JS999; 06-08-2009, 03:14 PM.

    #2
    Hello JS999,

    Thank you for your post.


    1.) I will attempt to recreate your setup and see how it performs on my end. Unfortunatelly this may take some time as I will have to wait for a period of high market activity.

    2 & 3.) Perhaps other NinjaTrader users can provide their experiences with real trades.
    Ray S.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RJStein View Post
      Hello JS999,

      Thank you for your post.


      1.) I will attempt to recreate your setup and see how it performs on my end. Unfortunatelly this may take some time as I will have to wait for a period of high market activity.

      2 & 3.) Perhaps other NinjaTrader users can provide their experiences with real trades.
      If you send me your email address I will email you my chart templates and workspace settings... should I just send it to [email protected] and address it to you? Obviously the best time to test would be tomorrow morning at 9:30 EST ... otherwise there is usually high activity around 3:50 to 4:00 EST right before the cash close on the indices...

      Comment


        #4
        Originally posted by JS999 View Post
        If you send me your email address I will email you my chart templates and workspace settings... should I just send it to [email protected] and address it to you? Obviously the best time to test would be tomorrow morning at 9:30 EST ... otherwise there is usually high activity around 3:50 to 4:00 EST right before the cash close on the indices...
        Yes, try going to Help --> Mail to Support and choose the workspace and templates option.

        If that doesnt' work, please zip the files and send them to [email protected]

        Thank you!
        Ray S.NinjaTrader Customer Service

        Comment


          #5
          Alright I will send you the setup (I am actually trying to make it even more simple as we speak)... but rather than having you trying to re-create my specific setup, what I really want to know is: is it really all that processor intensive? You should know just from looking at what I told you, without actually running it. If you don't personally know, then I am sure that one of the developers would know the answer to that question.

          In other words, have you seen other setups that have more going on that this, running just fine? (i.e. more charts, longer look-back periods, etc.) That's what I really need to know here, and I think that can be answered without running my actual setup. This is the type of thing that can be answered very easily by a programmer who actually understands the code path of the demo...

          From the help guide, I note the following:

          "NinjaTrader provides a state of the art internal simulation engine that you can use to test trading ideas and hone your skills. The simulation engine is not a simple algorithm that fills your order once the market trades at your order price. The engine uses a scientific approach to determine fill probability by including a number of variables including ask/bid volume, trade volume, time (to simulate order queue position) and random time delay for switching between order states."

          This is telling me that there are plenty of calculations going on there, and that it's trying to simulate my position in the order queue using the data coming in from time + sales. That also means that when the volume spikes then the calculations get bogged down and that's why the order can't be placed right away. At least that's my theory.

          In the real-world these calculations do not occur, which is why those orders SHOULD be placed instantly... but I just want confirmation of this based on real-world experience with other similar setups, and I'd really appreciate it if you could ask a programmer this question. Specifically, forward him/her my email and see what they say...

          In any case, I will simplify my setup even more and mail it to you for verification...

          Comment


            #6
            Also, please see this link as preliminary NT7 tests look like they will improve data performance considerably: http://www.ninjatrader-support2.com/...ad.php?t=17699
            Ray S.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RJStein View Post
              Also, please see this link as preliminary NT7 tests look like they will improve data performance considerably: http://www.ninjatrader-support2.com/...ad.php?t=17699
              This is good... I am awaiting NT 7 to see how things go. Just for reference, I have done some testing this morning with various settings, and I have narrowed down the performance issues to two main things:

              1. Time & sales is very intensive, removing it speeds up performance.

              2. Range charts are also very intensive... even without any indicators, a range chart seems to slow things down significantly. With a few range charts open the time and sales coming in lags in a noticeable manner.

              You should definitely forward this to development to make sure that they optimize all the constant volume/range/tick charts for NT7, as the current implementation basically doesn't work for real-time sub-second trading.

              Comment


                #8
                Originally posted by JS999 View Post
                This is good... I am awaiting NT 7 to see how things go. Just for reference, I have done some testing this morning with various settings, and I have narrowed down the performance issues to two main things:

                1. Time & sales is very intensive, removing it speeds up performance.

                2. Range charts are also very intensive... even without any indicators, a range chart seems to slow things down significantly. With a few range charts open the time and sales coming in lags in a noticeable manner.

                You should definitely forward this to development to make sure that they optimize all the constant volume/range/tick charts for NT7, as the current implementation basically doesn't work for real-time sub-second trading.
                --> I will forward to development.

                Thank you for testing and reporting!
                Ray S.NinjaTrader Customer Service

                Comment


                  #9
                  JS999,
                  This is a post I made in a thread about external data feeds.


                  Does this seem to fit with the issues you are experiencing?

                  Thanks for pointing this out...
                  Originally posted by JS999 View Post
                  From the help guide, I note the following:

                  "NinjaTrader provides a state of the art internal simulation engine that you can use to test trading ideas and hone your skills. The simulation engine is not a simple algorithm that fills your order once the market trades at your order price. The engine uses a scientific approach to determine fill probability by including a number of variables including ask/bid volume, trade volume, time (to simulate order queue position) and random time delay for switching between order states."
                  I wonder if the simulator in NT7 will be improved or if it could be dumbed down with a user selectable "switch". Or perhaps a slider to choose a range of behaviors from the most complex where the attempt is made to accurately model real markets to the most simple where instant fills with 0 slippage happen with zero delay.
                  I understand the desire to achieve realism in simulated order fills but as I describe (in the above link) under replay conditions there is no realism what so ever as the slippage is unrealistically huge. My actual experience in the Forex markets with Gain Capital is that there are always complete fills and virtually no slippage - except of course at a major news release - so the simulator's attempts at realism are needlessly complex. I realize though that this market is far more liquid than most.

                  Any comments from support on this? Any chance of more user control?

                  Thanks,
                  Gains

                  Comment


                    #10
                    Yes, that is similar. The solution in my case is to only run my trading copy of NT with very few charts open, and especially NOT to have a time and sales ticker open. (I do run a T&S on another copy of NT that I have running alongside it in a virtual machine, with more charts.) NT 6.5 is thoroughly unable to handle extremely heavy volume conditions for placing trades (or doing much else actually), as on my system it often "locks" while the T&S scrolls by at blinding speed. The temporary solution until NT7 is to run multiple copies of NT in virtual machines, and to make sure that your trading copy has very little open. (Also, Range and Volume charts are very slow, especially if you have more than one day open.) Hopefully NT7 will resolve these issues.

                    As for your problem, I don't think that there is much you can do about that delay in placing simulated trades... it's just not efficiently coded.


                    Originally posted by Gains View Post
                    JS999,
                    This is a post I made in a thread about external data feeds.


                    Does this seem to fit with the issues you are experiencing?

                    Thanks for pointing this out...


                    I wonder if the simulator in NT7 will be improved or if it could be dumbed down with a user selectable "switch". Or perhaps a slider to choose a range of behaviors from the most complex where the attempt is made to accurately model real markets to the most simple where instant fills with 0 slippage happen with zero delay.
                    I understand the desire to achieve realism in simulated order fills but as I describe (in the above link) under replay conditions there is no realism what so ever as the slippage is unrealistically huge. My actual experience in the Forex markets with Gain Capital is that there are always complete fills and virtually no slippage - except of course at a major news release - so the simulator's attempts at realism are needlessly complex. I realize though that this market is far more liquid than most.

                    Any comments from support on this? Any chance of more user control?

                    Thanks,
                    Gains

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Christopher_R, Today, 12:29 AM
                    0 responses
                    9 views
                    0 likes
                    Last Post Christopher_R  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    166 responses
                    2,235 views
                    0 likes
                    Last Post sidlercom80  
                    Started by thread, Yesterday, 11:58 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post thread
                    by thread
                     
                    Started by jclose, Yesterday, 09:37 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post jclose
                    by jclose
                     
                    Started by WeyldFalcon, 08-07-2020, 06:13 AM
                    10 responses
                    1,415 views
                    0 likes
                    Last Post Traderontheroad  
                    Working...
                    X