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 argusthome, Yesterday, 10:06 AM
            0 responses
            18 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            17 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            9 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            38 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X