Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT Performance Optimization and Directory Cleanup

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

    NT Performance Optimization and Directory Cleanup

    NinjaTrader performance optimization videos on YouTube often recommend regularly deleting cache, database, day, minute, tick, log, tmp, trace and other files to speed up NinjaTrader performance. Also, changing the process priority class to High, and increasing virtual memory to 1.5x to 3x RAM size is mentioned.

    What is NinjaTrader's position on these practices?
    If actually effective to increase NinjaTrader performance, how often should these directory cleanup actions be run?

    For example, below is batch file code with all actions commonly recommended:

    ​:: NinjaTrader File Cleanup and Optimization Batch File

    Rem rd - Remove Directory. Removes a directory in the current location. Directories must be empty before they can be removed.
    Rem /s - Removes a directory tree (the directory, all subdirectories, and all files), asking for confirmation once before proceeding with the removal.
    Rem /q - Quiet mode, with no prompt asking for confirmation before proceeding with the directory tree removal.
    Rem md - Make Directory. Creates a new directory in the current location.
    Rem start - Starts the program in a new window, closing the CMD console.
    Rem /High - Sets the program process to high priority class.

    rd /s /q "cache"
    md "cache"

    rd /s /q "db\cache"
    md "db\cache"

    rd /s /q "db\day"
    md "db\day"

    rd /s /q "db\minute"
    md "db\minute"

    rd /s /q /"db\tick"
    md "db\tick"

    rd /s /q "log"
    md "log"

    rd /s /q "tmp"
    md "tmp"

    rd /s /q "trace"
    md "trace"

    start "NinjaTrader" /High "C:\Program Files\NinjaTrader 8\bin\NinjaTrader.exe"

    Rem Additional Optimization Actions
    Rem 1) Delete .sqlite File (NT v8.1) [or .sdf File (NT v8.0)] at Documents\NinjaTrader 8\db\NinjaTrader.sqlite
    Rem 2) Reset Database: Disconnect Data Connection, then Control Center > Tools > Database Management > Reset DB​


    #2
    Where on YouTube are you finding these recommendations?
    Got links?

    I'd like to see the reasons behind this brutal slaughter of data.

    -=o=-

    Your batch file is doing way way WAY too much.

    That batch file is like clearing the land with a nuclear bomb,
    when all you really need to do is mow the lawn and maybe
    prune a few trees ...

    Comment


      #3
      Searching YouTube for "Ninjatrader Performance" returns those results. A few examples:
      NINJATRADER SLOW? USE THIS STANDARD MAINTENANCE ROUTINE
      NinjaTrader 8 Tutorial : How To Maintain Max Performance
      How To Speed Up Ninja Trader
      How to speedup Ninjatrader 8

      Comment


        #4
        Hello Lancer,

        Thanks for your post.​

        It is not suggested to delete the NinjaTrader 8\db folder data, such as the day, minute, tick, or database files.

        Deleting the database will cause you to lose data such as Trading Hours templates, Instrument lists, custom-created instruments, historical trade execution data, and saved Strategy Analyzer backtest results.

        NinjaTrader uses the saved historical data in the Documents\NinjaTrader 8\db folder to load the data on charts faster. Deleting the data in this folder will mean that NinjaTrader would have to redownload this data all over again when it is accessed.​

        You can experience slow and unresponsive behavior if you have many workspaces, charts, indicators and other windows opened depending on market volatility as well. If market volatility increases, the same setup will need more PC resources.

        The 'Calculate' setting for indicators and strategies can be important. If set to 'On each tick' or 'On price change', the indicator/strategy will be calculated on each incoming tick or each price change. During high volatility this can be very CPU intensive especially if the indicator/strategy makes complicated calculations. If you set it to 'On bar close', the indicator/strategy will only be calculated at the end of each price bar.

        I have provided a link below to our Help Guide that goes over performance tips:Optimizing your setup using the guide above can go a long way in helping reduce performance issues.​

        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          So, here is the question broken down into component parts:

          1) Does deleting and making a new directory "NinjaTrader 8\cache" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          2) Does deleting and making a new directory "NinjaTrader 8\db\cache" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          3) Does deleting and making a new directory "NinjaTrader 8\db\day" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          4) Does deleting and making a new directory "NinjaTrader 8\db\minute" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          5) Does deleting and making a new directory "NinjaTrader 8\db\tick" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          6) Does deleting and making a new directory "NinjaTrader 8\log" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          7) Does deleting and making a new directory "NinjaTrader 8\tmp" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          8) Does deleting and making a new directory "NinjaTrader 8\trace" improve NinjaTrader performance?
          If so, how often would this directory cleanup action be run to make any material improvement?

          9) For v8.0, does deleting the file Documents\NinjaTrader 8\db\NinjaTrader.sdf improve NinjaTrader performance?
          If so, how often would this file cleanup action be run to make any material improvement?

          10) For v8.1, does deleting the file Documents\NinjaTrader 8\db\NinjaTrader.sqlite improve NinjaTrader performance?
          If so, how often would this file cleanup action be run to make any material improvement?

          11) Does resetting the database at Control Center > Tools > Database Management > Reset DB​ improve NinjaTrader performance?
          If so, how often would this database reset action be run to make any material improvement?

          12) Does starting/running NinjaTrader with the process priority set to High improve NinjaTrader performance?

          13) Does increasing virtual memory to 1.5x to 3x RAM size improve NinjaTrader performance?​

          Comment


            #6
            Hello Lancer,

            Thanks for your notes.

            The NinjaTrader 8\cache folder is there to help speed things up in NinjaTrader 8. The items in this folder should not be removed.

            The historical data stored in the NinjaTrader 8\db folder is there to speed up the historical data being loaded when opening charts.

            Removing the NinjaTrader.sdf and NinjaTrader.sqlite files will not improve performance. Deleting the database will cause you to lose data such as Trading Hours templates, Instrument lists, custom-created instruments, historical trade execution data, and saved Strategy Analyzer backtest results.

            Removing items in the NinjaTrader 8\log folder and NinjaTrader 8\trace folder will not increase performance unless you have something on your platform that is creating very large files here.

            Items in the NinjaTrader 8\tmp folder should not be removed. Removing items in this folder could cause errors in the platform.

            The Tools > Database Management > Reset DB option does not improve performance.

            Increasing the process priority is not something that we recommend for increasing performance.

            The only item in your list that would increase performance is to increase the virtual memory so that you would have access to more RAM.

            Further, having fewer items/applications being run outside of NinjaTrader would increase performance.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Thanks Brandon. OK YouTubers running that .bat file, there you go.

              Comment


                #8
                Originally posted by Lancer View Post
                I haven't "cleaned" or deleted any files in my NinjaTrader folder for many years, and it's running just as well as it was on day 1.

                That first youtube video in your link, the first comment makes it sound like the problem might be with the addon?

                Click image for larger version

Name:	image.png
Views:	1457
Size:	71.2 KB
ID:	1259930
                Last edited by backtester831; 07-11-2023, 12:24 PM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                116 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                61 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                40 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                43 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                82 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X