There are many variables that contribute to overall performance of the NinjaTrader application.
|•||Different connectivity providers (market data vendors and broker technologies) that NinjaTrader supports vary in their level of real-time data service. For example, providers who deliver unfiltered tick data (submit all market ticks) will impose heavier processing load than a vendor that provides throttled market data. |
|•||The load you place on the NinjaTrader application (running 200 charts will consume more processing power than running only 20 charts) |
|•||The capability of your PC hardware (are you running a brand new state of the art machine or a 4 year old PC with limited RAM) |
The following are some suggestions that can help you fine tune your NinjaTrader installation to run optimally.
Chart Performance Tips
|•||Increase your chart refresh interval by increasing the value of the chart property "Display update interval (sec)" |
|•||Reduce the number of bars on your chart (days back or bars back settings under "Format Data Series" dialog window |
|•||Reduce the number of running indicators |
|•||If you are running a custom or 3rd party indicator or strategy, remove them to isolate if these custom NinjaScript objects may be a CPU or memory drain |
Variables that can impact market data latency
|•||Connecting wirelessly can drastically impact performance during heavy volume periods. Depending on signal strength, your modem/router is unable to push all the data through. This can be resolved by connecting directly into the modem/router via a hard line. |
|•||Serious abnormal increases in market volume |
|•||Data provider servers could be lagging |
|•||Limited bandwidth internet service (56K dial up modem is not acceptable for example) |
|•||Inadequate PC hardware or running too many applications on your PC |
Market Analyzer look back period
|•||"# bars to look back" property set this number to the minimum number of bars required to properly initialize any indicator columns. The higher the number, the longer it will take to load data and the more memory (RAM) NinjaTrader will use to hold the data in memory.|
|•||Within the Control Center window, select > > and uncheck "Record for market replay" |
|•||Within the Control Center window, select > > and uncheck *"Save chart data as historical" |
|•||Reduce the number of applications running on your PC |
* "Save chart data as historical" should only be checked if are using a connectivity provider that does NOT provide historical data
Logging and Printing
Extremely liberal use of Log() and Print() methods can represent a performance hit on your PC as it takes memory and time to process each one of those method calls. When running custom NinjaScript, especially when using CalculateOnBarClose = false, please be mindful of how often Log() and Print() methods are processed as it can quickly consume PC resources.
|•||Log() method should not be used except for critical messages as each log entry makes it to the Control Center log which stays active till the end of the day. Excessive logging can result in huge amounts of memory being allocated just to display all the log messages which would mean less memory for NinjaTrader to do other tasks.|
|•||Print() method can be used more liberally than the Log() method, but can still represent a performance hit if used with extremely high frequency. Consider decreasing the printing from your script if you experience slowdowns when running the script.|
Please also ensure you do not have Debug Mode enabled as it can lead to lower performance. To disable, right mouse click in any NinjaScript Editor and uncheck the "Debug Mode" menu item. After doing so, press F5 to recompile.
|•||Hidden workspaces consume CPU cycles so check under > to see all of the workspaces that are open and close any that you seldom or never use. |