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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      169 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      327 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      252 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      353 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      181 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X