Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Changing a Named Strategy's Stop Order

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

    Problem Changing a Named Strategy's Stop Order

    I use the following code to place an order.

    ocoId = "v3-DGS-BL";
    orderId = NTNewOrderId;
    ntCmdFailed = NTCommand( "PLACE", // string command,
    ntAccount, // string account,
    "BUY", // string action,
    10, // int quantity,
    "LIMIT", // string orderType,
    buyPrice, // double limitPrice,
    0, // double stopPrice,
    "DAY", // string timeInForce,
    ocoId, // string oco,
    orderId, // string orderId,
    "T-1,SL-2", // string strategy,
    orderId ); // string strategyId

    I use the following code to attempt to modify the Stop-Loss Limit of the orders
    strategy "T-1,SL-2" (Target: 1 StopLoss: 2). Once I am in the position for too
    long a time.

    ntCmdFailed = NTCommand( "CHANGE", // string command,
    "", // string account,
    "", // string action,
    0, // int quantity,
    "", // string orderType,
    Last, // double limitPrice,
    0, // double stopPrice,
    "", // string timeInForce,
    "", // string oco,
    "Stop1", // string orderId,
    "", // string strategy,
    orderId ); // string strategyId

    The change command returns successful. But Stop1 does not seem to change.

    Have I got something wrong?

    I am reusing my orderId (from NTNewOrderId) as a strategyId.



    #2
    imported post

    You are changing the limit price of the stop order. Look at where your "Last" parameter is.
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Thanks for spotting that.
      I'll make the change and test it out.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      88 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      34 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      69 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X