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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X