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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              63 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              35 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              54 views
              1 like
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              61 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              48 views
              0 likes
              Last Post CarlTrading  
              Working...
              X