Disable NT 7/8 error alerts in a strategy

Hi,

How can I disable the error alerts in an NT 7/8 strategy? I need the advice for NT 7 & 8. The below example of an alert I want to disable is correct, but I simply don’t want that it appears. I check in the C# code if the trade has been opened or not.

Hi @PeterVARGA,

If you use NinjaTrader version 8.1.5.0 or above, you can accomplish this by copying and pasting the following NinjaScript code into the overridden “OnStateChange()” method of your NinjaScript strategy, inside of an if block that reads “if (State == State.SetDefaults)”:

RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrorsNoAlert;

Here is a screenshot of how this could look, with the important bits highlighted:

Here’s a plain-English drop-down list of all the options for the “RealtimeErrorHandling” property of the NinjaScript strategy class in a no-code strategy built with the no-code strategy builder for NinjaTrader from Quagensia, which also shows that the “Ignore All Errors (No Alerts)” option whose NinjaScript code is above was introduced in NinjaTrader version 8.1.5.0:

Best regards,

Brook

1 Like

Thank you Brook. For NT 7 there is no solution so the alert can’t be disabled? I am in the process of migrating the strategy to NT 8 but - as always in the software development - I don’t know when it’s accomplished.

You are most welcome @PeterVARGA. Unfortunately I do not know a solution that works in NinjaTrader 7, nor in NinjaTrader 8 below version 8.1.5.0. Maybe another community member knows of a solution. I wish you the best if your conversion of your NinjaTrader 7 strategy to NinjaTrader 8. I really think you will like the improvements to the NinjaScript API in NinjaTrader 8.

1 Like