• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by xsgex, Yesterday, 09:46 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post xsgex
                      by xsgex
                       
                      Started by Steve L, Yesterday, 09:36 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post Steve L
                      by Steve L
                       
                      Started by krugman25, Yesterday, 09:34 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post krugman25  
                      Started by indy73, Yesterday, 04:42 PM
                      0 responses
                      15 views
                      0 likes
                      Last Post indy73
                      by indy73
                       
                      Started by Italianforex, Yesterday, 06:20 AM
                      2 responses
                      13 views
                      0 likes
                      Last Post gplatis
                      by gplatis
                       
                      Working...
                      X