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

Getting ChartTab

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

    Getting ChartTab

    Is it possible to get the ChartTab object the indicator resides on from within the indicator?

    #2
    Yes. Depends though on what you mean by get. What do you want to do with it?

    Comment


      #3
      Originally posted by Zeos6 View Post
      Yes. Depends though on what you mean by get. What do you want to do with it?
      Well, by "get" I mean to get it.
      Jokes aside: my indicators have a complex system to communicate with each other. In Nt7 I could use ChartId in the persistence department, but in Nt8 there are more tabs within a chart the indicator can be on so I'll need tabIds and all other info I can easily get if I have the actual ChartTab object the indicator is sitting on.

      My problem is that I cannot seem to find a way to access the ChartTab as I can the ChartControl and the OwnerChart.
      Last edited by Zapzap; 06-13-2018, 12:05 PM.

      Comment


        #4
        Originally posted by Zapzap View Post
        My problem is that I cannot seem to find a way to access the ChartTab as I can the ChartControl and the OwnerChart.
        ChartControl.ChartTab



        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          Lol, now this is embarrassing. How could I miss that?
          Thanks.

          Comment


            #6
            Originally posted by -=Edge=- View Post
            ChartControl.ChartTab
            Now if we take this a step further: I guess getting all ChartTabs/ChartControls on a given Chart is not this simple, is it.

            Comment


              #7
              Originally posted by Zapzap View Post
              Now if we take this a step further: I guess getting all ChartTabs/ChartControls on a given Chart is not this simple, is it.
              Guess it would depend on if you want all the tabs of just the indicators chart window, or if you want all the tabs from all the windows..

              In the first case..

              Code:
               Chart chartWindow = Window.GetWindow(ChartControl.Parent) as Chart; 
              [COLOR=#0000ff]foreach[/COLOR](TabItem tab [COLOR=#0000ff]in [/COLOR][COLOR=#0000ff]this[/COLOR].chartWindow.MainTabControl.Items)
              Example here.. . https://ninjatrader.com/support/help...th_buttons.htm

              If your looking for all tabs in all windows.. you'll prob want to start with something like this..

              Code:
               [COLOR=#0000ff]foreach [/COLOR]([COLOR=#080808]Window[/COLOR] [COLOR=#080808]window[/COLOR] [COLOR=#0000ff]in[/COLOR] [COLOR=#080808]NinjaTrader[/COLOR].[COLOR=#080808]Core[/COLOR].[COLOR=#080808]Globals[/COLOR].[COLOR=#080808]AllWindows[/COLOR]) { //do something }
              but I'm not sure how much this last one will be supported..



              -=Edge=-
              NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mizzouman1, Today, 07:35 AM
              4 responses
              18 views
              0 likes
              Last Post Mizzouman1  
              Started by philmg, Today, 01:17 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by cre8able, Today, 01:01 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by manitshah915, Today, 12:59 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by ursavent, Today, 12:54 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X