Thank you for your post.
What statements are you referring to?
Some general performance items on NinjaScript can be found below.
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.
Debug Mode
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.
Leave a comment: