Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyStopTargetOrderStatus

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

    GetAtmStrategyStopTargetOrderStatus

    According to the docs this method will return an empty array if it can't find the order.

    I'm getting a method error instead:
    **NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'TARGET1' does not exist

    Code snippet
    if (atmStrategyId.Length > 0)
    {
    string[,] Orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyId);
    // Check length to ensure that returned array holds order information
    if (Orders.GetLength(0) > 0)
    {
    for (int i = 0; i < Orders.GetLength(0); i++)
    {
    TargetStatus =Orders[i, 2].ToString();
    Print("Target1 Current state is, " + TargetStatus);
    }
    }
    }

    #2
    tquinn, but this was for a not active anymore or not yet started ATM strategy id, correct?

    Comment


      #3
      Correct, I've been looking at it wrong

      Comment


        #4
        This is the situation I have occurring (rarely) but I need to recognize and have a routine to handle.

        A) My strategy issues an ATM order which is filled (causing Targets and Stops to be working)
        B) Prior to exiting this position My strategy issues another ATM order in the opposite direction which is also filled

        This results in being flat the market, but having 4 orders working (2 OCO pairs) the results are unpredictable but usually bad.

        I wanted to check for this by using GetAtmStrategyStopTargetOrderStatus() looking for two TARGET1 orders which are Working.

        I can do this, but it fills my Output window with the method errors.

        Is there a way to check for this condition without generating the errors?

        Tom

        Comment


          #5
          How do you exit the position then, with the AtmStrategyClose()? If do this, then the orders should be cancelled and only your current working one be 'working', which would be accessible since they belong to the current active (non reset) ATM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          650 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          577 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X