Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
        BertrandNinjaTrader Customer Service

        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?

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ETFVoyageur, Today, 02:15 AM
            0 responses
            5 views
            0 likes
            Last Post ETFVoyageur  
            Started by Board game geek, Today, 01:34 AM
            0 responses
            5 views
            0 likes
            Last Post Board game geek  
            Started by morrnel, 05-12-2024, 06:07 PM
            3 responses
            39 views
            0 likes
            Last Post wzgy0920  
            Started by FishTrade, Yesterday, 11:11 PM
            0 responses
            7 views
            0 likes
            Last Post FishTrade  
            Started by Austiner87, Yesterday, 03:42 PM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X