Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update order

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

    Update order

    If I enter a limit order (in a strategy) and want to update the price, do I need to have assigned a name to the order? How do I do that and are there any examples to view?

    #2
    Hello malcolm,

    Thanks for your post.

    No, you do not need a name. If a limit order has not yet been filled and you submit a limit order at a different price, the price will be adjusted.

    Here is a quick example to demonstrate:

    if ((State == State.Realtime)
    && (Doitonce == true)) // Doitonce is a bool that is initially set to true
    {
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Low[0] + (-10 * TickSize)) , ""); // this is the initial order 10 ticks below the low of the just closed bar, done once
    Doitonce = false;
    }

    // Set 2
    if (Doitonce == false)
    {
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Low[0] + (-20 * TickSize)) , ""); // This adjusts the same order to 20 ticks below the low and will be different price on each new bar
    }



    Note: If you did use a signal name you would need to use the same signal name to update the same order. Same example but with a signal name:

    if ((State == State.Realtime)
    && (Doitonce == true)) // Doitonce is a bool that is initially set to true
    {
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Low[0] + (-10 * TickSize)) , "Test"); // this is the initial order 10 ticks below the low of the just closed bar, done once
    Doitonce = false;
    }

    // Set 2
    if (Doitonce == false)
    {
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Low[0] + (-20 * TickSize)) , "Test"); // This adjusts the same order to 20 ticks below the low and will be different price on each new bar
    }

    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
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X