Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Gaby V.NinjaTrader Customer Service

    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.
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, Today, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        7 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Today, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        151 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Working...
        X