Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble with unmanaged

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

    Trouble with unmanaged

    I'm having a problem that I hope someone can set me straight on.


    1) Current Ask is 500. I'm putting in multiple buy prices. The first at 400 and the second at 300.
    2) The first buy price is hit when it pulls back to 350. The price then moves up to its exit/target price.
    3) Since the second buy price @ 300 (which was entered at the same time as the first buy) was never reached on the pullback, I now need to cancel that order.

    1 & 2 are working fine. However, for whatever reason, I cannot get #3 to happen. In the:

    protected override void OnOrderUpdate(IOrder order)

    section, I'm putting in the following:

    Code:
                if (targetOrder1 == order)
                {
                    Print(order.ToString());
                    if (order.OrderState == OrderState.Filled)
                        CancelOrder(entryOrder2);
                }
    The idea is that once the first target has been reached and filled, the second order ("entryOrder2") should be canceled if it was not filled to begin with. However, it isn't happening.

    Could someone tell me what is wrong with my methodology?

    Thanks

    #2
    I seemed to have fixed the problem. Not exactly sure what was going on. I'm still a little confused by the whole Unmanaged situation.

    Anyhow. While I have your attention. Is there a command to cancel all pending orders? Or do I have to do each individually?

    Comment


      #3
      lookOutBelow, unfortunately there is not a method to close out all pending orders. At the moment, it is necessary to cancel each individually.
      AustinNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      637 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X