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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      64 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X