Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RealtimeErrorHandling.IgnoreAllErrors for errors that are not Order-related.

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

    RealtimeErrorHandling.IgnoreAllErrors for errors that are not Order-related.

    Hi,

    I'm using RealtimeErrorHandling.IgnoreAllErrors to handle errors from orders using the strategy, and I've placed code in OnOrderUpdate to capture them.

    My question is:
    - If other errors occur that are not related to orders, for example, when creating buttons dynamically or displaying additional custom information either on the chart or in the chart trader, where should these errors be captured?
    - If errors occur while doing what's in the example, does the strategy continue to function and not exit as it would if I didn't use RealtimeErrorHandling.IgnoreAllErrors?
    - Do these other errors appear in the log?​

    Thank you

    #2
    Hello ervin,

    Thank you for your post.

    You can use try/catch blocks to trap any exceptions that aren't order rejections, below is a sample script demonstrating using try/catch blocks:



    IgnoreAllErrors would prevent the strategy from cancelling any orders or closing itself if any order-related errors happen. This would not apply to any runtime errors like you are describing. You would still need to add your own logic to deal with capture these errors if they occur, for example using try/catch blocks.

    Runtime errors will appear in the Log tab of the Control Center.

    Please let me know if you have any other questions.
    Last edited by NinjaTrader_Gaby; 02-20-2024, 10:50 AM.

    Comment


      #3
      Thank you Gaby,
      I'm using Try - Catch blocks, but not in the enterly script because is long.
      Is there a way to capture this errors in some Event or something like that when RealtimeErrorHandling.IgnoreAllErrors is established.?

      Comment


        #4
        Hello ervin,

        Thank you for your response.

        There is not an equivalent for runtime errors like RealtimeErrorHandling.IgnoreAllErrors, which is only for order-related errors.

        The only recommendation I can make is using try/catch blocks for specific sections of code, for example like you mentioned trying to create a button.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        38 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X