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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Aviram Y, Today, 05:29 AM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    26 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by bmartz, 03-12-2024, 06:12 AM
    3 responses
    30 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X