Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyStopTargetOrderStatus("STOP2", "idValue")

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

    GetAtmStrategyStopTargetOrderStatus("STOP2", "idValue")

    Hi,

    I am using AtmStrategyCreate() to enter with a strategy previously created in the DOM. I then manage in the DOM.

    Is it possible to know in my program the current stoploss location even if it's moved?

    Would I do it like this?

    if ((atmStrategyId.Length > 0) && (GetAtmStrategyPositionQuantity(atmStrategyId) != 0))
    {
    string[,] orders = GetAtmStrategyStopTargetOrderStatus("STOP2",atmStr ategyId);
    Print("Current Stop is " + orders[0, 0].ToString());
    }

    I'm trying to do it like that and I keep getting "0" instead of the stop location.

    Thanks,

    Folls

    #2
    To double check...

    - The ATM strategy was generated via a NinjaScript strategy? If not, you will not be able to programatically manage it
    RayNinjaTrader Customer Service

    Comment


      #3
      Yes and I'm able to move the stop loss with AtmStrategyChangeStopTarget. However, I can't figure out how to print the current value of the stop (if that's possible).

      Thanks,

      Folls

      Comment


        #4
        I just checked...Price of current stop/targets is not retrievable.
        RayNinjaTrader Customer Service

        Comment


          #5
          OK. Thanks.

          Folls

          Comment


            #6
            Is it possible to find out if the "TARGET1" still exists? I'm trying to do this and keep getting a length of zero for the orders array with the following:

            //get order status
            string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", "atmStrategyId");
            //if the order can't be moved
            if ((orders.Length == 0) || (orders[0,2] == "Cancelled" || orders[0,2] == "Rejected" || orders[0,2] == "Filled"))

            Thank you,

            Folls

            Comment


              #7
              If it can't find the order then an empty array is returned. Thus, you can't tell what the status is. Try checking a method that checks a property of the ATM strategy. If that is successful (you get some meaningful data back) then you can check for the status of a target.
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              582 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              338 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
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X