|09-02-2008, 12:59 AM||#1|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Thanked 272 times in 96 posts
Indicator: Using Try-Catch Blocks
Debugging your NinjaScript code can be time consuming and frustrating. When NinjaTrader encounters a run-time exception in your programming logic it will terminate the execution of the script and log the exception to the Control Center Log tab. This in itself can be of value however, there may be times where your script is too large and the exception error message provided is not granular enough. This is where standard C# exception handling using the keywords “try” and “catch” (try–catch block) can be very useful. A try-catch block allows you to encapsulate a section of your code to trap exceptions and write out meaningful information that can help you resolve your run-time errors.
Key concepts in this example:
Important related documentation:
Last edited by NinjaTrader_Jesse; 05-03-2015 at 12:00 PM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Indicator: Removing and Custom Formatting an Indicator’s Chart Label||NinjaTrader_Josh||Reference Samples||0||12-30-2007 07:49 PM|
|Strategy Catch Up||ohowie||Suggestions And Feedback||5||12-30-2007 07:46 PM|
|Once NT6 data becomes delayed it doesn't catch up to be real-time||dfogg||Connecting||11||08-17-2007 07:41 AM|
|Catch the end of a minute bar on a tick by tick OnBarUpdate event||Fabrice||Automated Trading||5||07-06-2007 12:28 PM|
|Catch the end of a minute bar on a tick by tick OnBarUpdate event||Fabrice||Automated Trading||1||07-06-2007 06:53 AM|