Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

update order price for unmanaged orders

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

    update order price for unmanaged orders

    I am using unmanaged orders approach.

    I have two StopMarket orders with names 1.2 and 2.2. When price reaches A, I want to change StopPrice of order 1.2 to B. When price reaches C, I want to change StopPrice of order 2.2 to D. How can I change these prices from OnBarUpdate?

    #2
    Hello Eklavya,

    Thanks for your post.

    You can use ChangeOrder to change the properties of an order.

    ChangeOrder - https://ninjatrader.com/support/help...hangeorder.htm

    For more information on using Order objects, please see the SampleOnOrderUpdate strategy. This example outlines how to assign Order objects in OnOrderUpdate and can also be used for demonstration on how to submit target and stop loss orders from OnExecutionUpdate.

    SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    I look forward to being of further assistance.

    Comment


      #3
      ChangeOrder needs the order object to change right? How do I get that in the OnBarUpdate method?

      Comment


        #4
        Hello Eklavya,

        The order object is assigned in OnOrderUpdate and then can be accessed in OnBarUpdate. Please see SampleOnOrderUpdate for using OnOrderUpdate and assigning order objects.

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        13 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        59 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        41 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        47 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        38 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X