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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X