Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Canceling a submitted order

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

    Canceling a submitted order

    Question:
    I am submitting a Stop order when Condition X is met. The order submits fine and shows up with a blue "Accept" in the Orders tab. However if Condition Y occurs (before order gets filled), I need to cancel the "accept"-ed order.
    How do I do this?

    Actually, what I really need to do is - if Condition Y occurs before order gets filled, then update the "accept"ed order with an new Stop value. So either cancel and resubmit, or update existing queued order.

    Problem is - I do not know how to find the handle to the pre-submitted order to issue this change (or cancellation)
    Last edited by nybangali; 10-24-2008, 02:00 AM.

    #2
    Hi nybangali,

    To cancel orders you need to use CancelOrder(). You can only use that if you have an IOrder object containing your order. What this means is when you submit orders you will want to do something like this:
    Code:
    // In Variables
    private IOrder stopOrder = null;
    
    // In OnBarUpdate()
    stopOrder = ExitLongStop(100);
    CancelOrder(stopOrder);
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X