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

How to identify the ATM Strategy

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

    How to identify the ATM Strategy

    Hi masters

    I have the orders and now i need to know what ATM Strategy name is used each order.
    For sample, I tried to code this way:

    var teste = order.GetOwnerStrategy();
    string ATMName = teste.Name; // doesnt work

    error message: Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

    Thnaks

    #2
    Hello MarceloF,

    Thank you for the post.

    Can you provide more context on how these orders have been generated?

    For ATM strategies and NinjaScript, there are specific ways to submit orders which would also entail that you already have the name of the associated template when you submit the order.

    Are you manually submitting an ATM strategy order and later trying to retrieve it? The GetOwnerStrategy() is not a documented item so I would be unable to provide any further detail on what you are trying in this example.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello great Jesse
      What I just would like to know which ATM is being used in each order executed (Entry) along the code in an indicator. I already have access to the orders this way:

      lock (myAccount.Orders)
      foreach (Order orderAux in myAccount.Orders)
      {

      }


      I do not want to send order or know ATM status.
      I just want to know the name of the ATM that is being used at the instant of opening a position, the name as shown in the table atached.

      Thanks
      Attached Files

      Comment


        #4
        Hello MarceloF,

        Thank you for the reply.

        I understand you want the name of the strategy, but I would still need to know what scope you are submitting these orders. Are these manual orders or is the indicator submitting the order?

        For manual orders or orders that did not originate from this script, I would need to further research this to see if there is an exposed property or method to access the template name. Currently, I can't see any object in the Order object which would represent the template name.

        For orders that originated from this script, you should instead be tracking the template name in your logic based on the order's name, orders object or other logic you choose.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse thanks for the answer

          manual orders... from SuperDOm

          Comment


            #6
            Do you have any tips on where I think I find this information?
            thanks

            Comment


              #7
              Hello MarceloF,

              Thank you for the reply.

              As noted because this is a manual order, I will need to do further research on this topic. At this time I do not have a specific suggestion but once I have more information on this I will reply back with that information.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Hello MarceloF,

                After speaking with development further I will need to put in a feature request as this information is not already exposed for NinjaScript access.

                It is currently not possible to access the template name historically, this is also not an item that is associated directly with an Order object. Looping over the orders will not contain this information but it is possible to loop over the strategies collection to locate active atm strategies that contain the same order. This is cleared once the orders fill which makes that not valid to continually locate the name based on an order. There would be no specific suggestion at this time for a way to access this, once I have the tracking ID for this request I will provide that here.

                Please let me know if I may be of additional assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  thanks Jesse
                  Another way is if we have accese to "Orders Tab", if we can do that.. i can find the orders Ids and cross the informations.. is possible??
                  Attached Files

                  Comment


                    #10
                    Hello MarceloF,

                    While you likely can access the grid in undocumented ways I would have no suggestion on how to try and access the single rows of the grid in a way which would also allow access to the end result displayed data. In general, this is not a good approach at accessing data due to having to use dispatchers to invoke code on the UI thread. You are free to try it out though and see if you can access the information you wanted with the grid in some way. Once I have the tracking ID for the feature request I will provide that here as well.



                    I look forward to being of further assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      Hi Jesse

                      Jesse I got it ... it was very difficult but I got it ... it was by the Globals.AllWindows ... regards and see you soon THANKS

                      Comment


                        #12
                        Originally posted by MarceloF View Post
                        Hi Jesse

                        Jesse I got it ... it was very difficult but I got it ... it was by the Globals.AllWindows ... regards and see you soon THANKS
                        Hello MarceloF I would like to know how did you get the strategy template in the Order Tab. Kindly share it please.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by CortexZenUSA, Today, 12:53 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post CortexZenUSA  
                        Started by CortexZenUSA, Today, 12:46 AM
                        0 responses
                        0 views
                        0 likes
                        Last Post CortexZenUSA  
                        Started by usazencortex, Today, 12:43 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post usazencortex  
                        Started by sidlercom80, 10-28-2023, 08:49 AM
                        168 responses
                        2,262 views
                        0 likes
                        Last Post sidlercom80  
                        Started by Barry Milan, Yesterday, 10:35 PM
                        3 responses
                        10 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Working...
                        X