Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order handling

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

    Order handling

    Hi!

    I'd like to ask a few questions.

    1) Is that right that i cant place EnterLongStop on high and EnterShortStop of low of the bar at the same time in the current NT version?

    2) when entering a few orders with liveUntilCancelled = true, and have them all on a market, at some point i would like to cancel them all. Is there any way to do that, other then using CancelOrder (IOrder myEntryOrder), because for that i will need to remember all instances of orders i placed, but i don't know how many there will be before conditions to cancel will emerge.

    Thanks!!

    #2
    Hi Am851, to answer your questions:

    1) You are correct. NT 6.5 doesn't allow two opposing orders at the same time.
    2) CancelOrder() is the only method to cancel orders. You might want to look into using an ArrayList to store all the orders you might want to cancel in the future--it keeps a whole list of orders together, which can make organizing orders easier.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks!

      Im using ArrayList to store orders, that seems to work.

      Orders.Add(lORder);


      When its time to delete im using the following code:

      foreach( IOrder Order in Orders)
      CancelOrder(Order);

      and that doesnt work, even thou Orders.Count > 0. What am i doing wrong?

      Thanks.

      Comment


        #4
        CancelOrder would cancel an order in NinjaTrader, to manage the list either 'clear' it or use 'remove', point 6 in the link Austin posted.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          CancelOrder would cancel an order in NinjaTrader, to manage the list either 'clear' it or use 'remove', point 6 in the link Austin posted.

          sorry, what I mean is that code does not send a cancellation, all orders are still on the market

          Comment


            #6
            Am851, ok are you sure you cancel the correct IOrder object(s) ? Please print the ones used to the output window and compare. Also: do you spot any errors in the log tab? Are you working with TraceOrders to debug already?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X