Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to ChangeOrder(..) UnManaged

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

    How to ChangeOrder(..) UnManaged

    deleted...
    Last edited by defa0009; 09-20-2024, 03:36 PM.

    #2
    Hello defa0009,

    Do you mean a stop market order or a limit order? A market order cannot be changed, that will fill at the next best price and does not have a stop or limit price.

    You would otherwise do just like is shown in the help guide for ChangeOrder to change an order that does have a stop or limit price, you would fill in the overloads. https://ninjatrader.com/support/help...hangeorder.htm

    The account.Change is not correct for use with the managed or unmanaged approach.

    Comment


      #3
      Hello defa0009,

      Even with the changes it would be the same answer, you can see the help guide example for ChangeOrder, that is the correct way to change orders. Using Account.Change is not correct for the managed or unmanaged approach and should not be used.

      Comment


        #4
        Hello defa0009,

        How are you finding the order in your custom method? A variable should have been preset from OnOrderUpdate, are you doing that part of finding the order and storing it to a variable? If you are using the account directly to find orders that is also not correct for the unmanaged approach, you can see the following sample which shows the saving of orders to variables, those variables would be the orders that can be controlled with ChangeOrder.

        Comment


          #5
          Hello defa0009,

          The addon framework is not intended to be used with strategies, none of the strategy based properties or methods are for use with manual orders which the addon framework creates. You need to switch from using the addon framework to using the managed or unmanaged approach if you are using a strategy.

          Comment


            #6
            Hello defa0009,

            In that case I would suggest using an indicator so you won't get confused with strategy properties or methods that do not apply. The addon framework is not intended to be used in strategies because that will not work in combination with the strategies virtual properties or methods.

            To cancel orders that can be cancelled you can use the Cancel function on the account variable, market orders cannot be cancelled.

            To close a position you entered you can just submit an order in the opposite direction which will close out that position.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            43 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            21 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            30 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            50 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Working...
            X