Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 cre8able, Yesterday, 01:16 PM
              3 responses
              11 views
              0 likes
              Last Post cre8able  
              Started by ChartTourist, Today, 08:22 AM
              0 responses
              4 views
              0 likes
              Last Post ChartTourist  
              Started by LiamTwine, Today, 08:10 AM
              0 responses
              2 views
              0 likes
              Last Post LiamTwine  
              Started by Balage0922, Today, 07:38 AM
              0 responses
              5 views
              0 likes
              Last Post Balage0922  
              Started by JoMoon2024, Today, 06:56 AM
              0 responses
              6 views
              0 likes
              Last Post JoMoon2024  
              Working...
              X