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

Get ChartTrader ATM strategy name string from indicator

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

    Get ChartTrader ATM strategy name string from indicator

    I would like to retrieve the current selected ATM Strategy name string in the ChartTrader combobox from an indicator. I am able to use the code below to get the order qty but it does not work with the ATM strategy.

    Code:
    Grid ctGrid = ((chartTrader.FindFirst("ChartWindowChartTraderControl") as ChartTrader).Content as System.Windows.Controls.Grid).Children[1] as System.Windows.Controls.Grid;
    TextBox tboQuantity = ctGrid.FindFirst("ChartTraderControlQuantityEdit") as TextBox;
    quantity = Int32.Parse(tboQuantity.Text, NumberStyles.AllowThousands);
    
    // FOLLOWING DOES NOT WORK
    Grid ct2Grid = ((chartTrader.FindFirst("ChartWindowChartTraderControl") as ChartTrader).Content    as System.Windows.Controls.Grid).Children[2] as System.Windows.Controls.Grid;
    ComboBox cboStrategy = ct2Grid.FindFirst("ChartTraderControlATMStrategySelector") as ComboBox;
    strategy = cboStrategy.SelectedItem.ToString();
    It returns the following strategy = "name='AtmStrategy' id=-1" no matter what the actual strategy name string is. Actually it does return the correct string when the "None" selection is made.

    I think it does not work because the items in the ATM strategy combobox are not simple text but some undocumented objects for the "i" and "remove" etc. Can you please provide an example of retrieving the ATM Strategy name from the combobox or using any other method available to do it.
    Last edited by seahn; 01-13-2017, 07:46 PM.

    #2
    Hello,

    Thank you for the post.

    I had previously commented on this topic in this thread: http://ww.ninjatrader.com/support/fo...44&postcount=7

    You are correct, the object and property used would be custom rather than the SelectedValue.

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

    Comment


      #3
      Hi Jesse

      Is possible to acsses the ATMStrategy Name from SuperDom??

      Thanks

      Comment


        #4
        Hello MarceloF,

        Yes, that would be possible and would be nearly identical to the chart trader sample:


        The ID is SuperDOMControlATMStrategySelector.

        What context are you trying to access this from? Is this an indicator or addon? Where would this information be needed?

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

        Comment


          #5
          Indicator

          Thanks Jesse

          Comment


            #6
            Hello MarceloF,

            Would this be an indicator in a chart or applied directly to the dom?

            From a chart, you would need to use the Globals.AllWindows collection and find the dom you wanted to target.

            From the indicator applied to the dom, you could use the Parent property just like you would in the ChartTrader example.

            Can you clarify what specific indicator application you wanted? With more specific details I can provide more specific direction.

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

            Comment


              #7
              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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              13 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by alifarahani, Today, 09:40 AM
              5 responses
              23 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X