![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Reference Samples Official NinjaScript reference code samples |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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.
This reference sample demonstrates the following concept:
Josh
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Josh for this post: |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| 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 06:49 PM |
| Strategy Catch Up | ohowie | Suggestions And Feedback | 5 | 12-30-2007 06: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 |