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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X