Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop position from code

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

    stop position from code

    will this code give you the current value/position of a stop?

    if not, is there code for that?

    thanks

    protected override void OnBarUpdate()
    {
    string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", "idValue");

    // Check length to ensure that returned array holds order information
    if (orders.Length > 0)
    {
    for (int i = 0; i < orders.GetLength(0); i++)
    {
    Print("Average fill price is " + orders[i, 0].ToString());
    Print("Filled amount is " + orders[i, 1].ToString());
    Print("Current state is " + orders[i, 2].ToString());
    }
    }
    }

    #2
    No, you will have to run your own variables to track it should you want to track it. You know your entry price and you know the offset you submitted at so it is just a matter of doing the math.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      that is not why I need it

      I already track the stop from initial through every time I move it

      what I was looking for was the ability to have the code check if the stop has been moved manually

      thanks anyway

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      601 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      559 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      558 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X