• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RealtimeErrorHandling.IgnoreAllErrors

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

    RealtimeErrorHandling.IgnoreAllErrors

    Hello,

    I configured my strategy with RealtimeErrorHandling.IgnoreAllErrors.
    I am handling order rejected in OnOrderUpdate.
    The problem is that I receive popup messages of rejected order.
    How can I disable those popup messages?

    It's even getting worse if I run 20 strategies at same time?

    Sincerely,Kobi

    #2
    Hello levikNT,

    Thank you for the question.

    This is currently expected that the rejection error is still displayed as there was a rejection, only the strategy ignores this and the platform still reacts. There is currently no option to disable this error specifically so I will need to put in a feature request here. Vote added to SFT-671.

    You may be able to use a separate addon to control this on your own by observing when new windows are created, and checking if the new window is the error window and then closing it. I don't have any kind of sample of that concept specifically, however, we did previously have a question of finding a button in the control center and clicking it. This may be able to be used in a similar way to close an error window.

    The code below specifically finds the control center window and clicks the X. If you instead used the OnWindowCreated override from an addon and observed the created windows, you may be able to determine it is an error window and just close it from that scope. Most windows have automation ID's for controls, this may be one way to determine it is an error window.

    This is not something I will be able to directly post a sample for, I don't believe this would be a good item to have freely available on the forum for direct download as auto closing errors could pose a fairly large problem if it goes unmonitored. If you wanted to give this a try I believe this would likely be a path toward that goal.

    Code:
    ControlCenter cc = NinjaTrader.Core.Globals.AllWindows.First(t => t is ControlCenter) as ControlCenter;
    if (cc != null)
    {
        cc.Dispatcher.InvokeAsync(() =>
        {
            System.Windows.Controls.Button closeButton = cc.FindFirst("NTWindowButtonClose") as System.Windows.Controls.Button;
            if (closeButton != null) {
                System.Windows.Automation.Peers.ButtonAutomationPeer peer = new System.Windows.Automation.Peers.ButtonAutomationPeer(closeButton);
                System.Windows.Automation.Provider.IInvokeProvider invokeProv = peer.GetPattern(System.Windows.Automation.Peers.PatternInterface.Invoke) as System.Windows.Automation.Provider.IInvokeProvider;
                if (invokeProv != null) invokeProv.Invoke();
            }
        });
    }



    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 04-01-2019, 10:21 AM.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Atilla, Today, 04:26 AM
    0 responses
    1 view
    0 likes
    Last Post Atilla
    by Atilla
     
    Started by FelixMMM, Today, 04:11 AM
    0 responses
    1 view
    0 likes
    Last Post FelixMMM  
    Started by TazoTodua, Today, 02:02 AM
    0 responses
    2 views
    0 likes
    Last Post TazoTodua  
    Started by rehema, Today, 01:29 AM
    0 responses
    5 views
    0 likes
    Last Post rehema
    by rehema
     
    Started by Papercut110, Yesterday, 11:25 PM
    0 responses
    3 views
    0 likes
    Last Post Papercut110  
    Working...
    X