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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X