Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent order placement

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

    Prevent order placement

    I'm writhng an addon for NT8 that will monitor all orders placed in the system. Depending on circumstances, I'd like to be able to prevent order from being placed.
    To achieve that I am subscribing to account.OrderUpdate:
    Code:
    account.OrderUpdate += OnOrderUpdate;
    and

    Code:
            private void OnOrderUpdate(object sender, OrderEventArgs e)
            {
                if (e.OrderState == OrderState.Initialized)
                    e.Order.Account.Cancel(new[] { e.Order });
            }
    That works, but the problem is that notification message pops up


    Is there any method to prevent order from being placed without such a message?

    Thanks

    #2
    Hello,

    Thank you for the question.

    There would be no way to disable the error boxes in this case, any log level error would be displayed as an error box.

    I have put in a feature request to direct the error to the output instead of a popup as an option.

    There is also an undocumented and unsupported item that was brought to my attention called QueueCancel(e.Order); if you choose to use it we could have you report back here any details of using this.

    I have attached a sample script that was provided to me that demonstrates this.


    I look forward to being of further assistance.
    Attached Files
    Last edited by NinjaTrader_Jesse; 12-21-2015, 04:40 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    666 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    377 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X