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 Haiasi, 04-25-2024, 06:53 PM
        2 responses
        16 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,407 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X