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

Accessing ATM target and stop prices

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

    Accessing ATM target and stop prices

    In my strategy I use ATMStrategyCreate(...);
    I would like to access the limit price associated with the stop and target orders.

    I use the OnOrderUpdate methods and when the target and stop orders are created, there is no call to OnOrderUpdate.

    I am aware of the methods that provide order status, pnl, avgPrice, filled quantity.

    How can I get the price value from the target and stop orders of the ATM that is running?

    Thanks,
    Gary

    #2
    Hello Gary,

    Thank you for writing in, We are currently investigating this further and will update this thread as soon as possible.

    Thank you for your patience in the meantime.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Hello Gary,

      While there is no supported method to do this, you can grab the values from the account orders collection:
      Code:
      foreach(Order o in Account.Orders)
      {
      	if(o.Name == "Stop1")
      	{
      		Print(o.Name + ": " + o.StopPrice);
      	} else if(o.Name == "Target1")
      	{
      		Print(o.Name + ": " + o.LimitPrice);
      	}
      }
      You would also want to check that the ATM entry had filled because until that point, the Stop and Target are going to have placeholder values.

      Please let me know if I may be of further assistance.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #4
        ATM stop and target orders to OnOrderUpdate in NT 8?

        Has NT 8 been enhanced to make OnOrderUpdate calls for ATM stop and target orders?

        I would like to get access to the stop and target orders in my strategy code so that the code could submit changes to those orders (change in price) among other things.

        Gary

        Comment


          #5
          Hi Gary,

          The idea of using Atm Strategies from a NinjaScript Strategy is to automated the triggering of the entry and then fully allowing the Atm Strategy to manage the order from that point forward.

          The orders placed with Atm Strategy commands do not affect the strategy position, strategy performance, and do not trigger any of the internal methods. In a way, its as if a manual order was placed.

          There are methods to intervene with the Atm Strategy using GetAtmStrategyStopTargetOrderStatus() to see if the stop or targets have filled.
          http://ninjatrader.com/support/helpGuides/nt7/getatmstrategystoptargetorders.htm

          And AtmStrategyChangeStopTarget() to move one of these.
          http://ninjatrader.com/support/helpG...stoptarget.htm
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thanks Chelsea, I had missed seeing those methods. They should do what I wanted.

            Gary

            Comment


              #7
              This is an old thread, but you all have still not fixed this issue. You allow us to get status information on the stops and targets of an ATM created by a strategy by specifying the atm order id.

              QUESTION: Since the returned value is just a string[,], why don't you populate all of the data about the order and give it back to us as a string[,], instead of just one or two fields, give us all the information we need, including the order id, stop price or limit price, etc.?

              The issue is this, what happens when more than one strategy is running in the same account? Stop1 would be in the account order collection twice. On which order is this strategy trying to move the stop, nobody knows.

              This change would require little effort on your part and give we programmers a way to know if they should move the stop/target when basing the stop price (for instance) on another indicator. If the atm moves the stop earlier than our indicator, we might not want to adjust the stop, but if the stop price is further away than the indicator, we might want to move it. Just give us back all of the information about the order and not just the status.

              Thank you,

              ld

              Comment


                #8
                Hello ld,

                Are you finding with the Atm ID you are unable to get the status of the stop or target?

                If there are multiple stops and targets running for multiple Atm Strategies that use different IDs running on the same account, the GetAtmStrategyStopTargetOrderStatus() method will only return the stops and targets for the specified active Atm by providing the ID. It will not return stops and targets in the collection for any other active Atm strategies that may also have been submitted by the strategy. You would keep track of these by keeping tracking of the Atm IDs.

                I'm happy to submit a feature request on your behalf.

                To confirm, you would like a method to return a large array of all orders that have Atm Strategies attached instead of just the information for the Atm with the requested ID, is this correct?

                Further, you would like an Order object returned instead of the average fill price, the current filled amount, and the status of the order, is this correct?
                Last edited by NinjaTrader_ChelseaB; 06-11-2018, 07:59 AM.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hi NinjaTrader_ChelseaB,

                  If you populate the information in the string[,], we can find what we need for Stop1, Target1, Stop2, etc.

                  The issue is that today, you ONLY give a status which is pretty much worthless. I don't care if it is an Order object or the string[,], Just give us back ALL of the information on the order we requested information.

                  We do not need a large order array of all of the orders. The methods we can call are fine, just not populated with enough information.

                  An order object would be preferable, because we can call methods on that object, and not have to do string comparisons, but if you retain the string[,], you can update the code at any time and not need to change the "interface".

                  Leroy

                  Comment


                    #10
                    Hello Leroy,

                    I've received tracking ID #SFT-1434 for your request for GetAtmStrategyStopTargetOrderStatus() to return all information for the order object.

                    Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.

                    We appreciate your feed back. Please let me know of any other suggestions you have for the NinjaTrader platform.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by jclose, Today, 09:37 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post jclose
                    by jclose
                     
                    Started by WeyldFalcon, 08-07-2020, 06:13 AM
                    10 responses
                    1,414 views
                    0 likes
                    Last Post Traderontheroad  
                    Started by firefoxforum12, Today, 08:53 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post firefoxforum12  
                    Started by stafe, Today, 08:34 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post stafe
                    by stafe
                     
                    Started by sastrades, 01-31-2024, 10:19 PM
                    11 responses
                    169 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X