Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Convert/Reference

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

    Convert/Reference

    From within an Indicator, How would I

    1.) Convert - NinjaTrader.Server.AtiServer atiServer = NinjaTrader.Cbi.Globals.AtiServer;

    2.) Get/Reference my Main Control Center: ControlCenter myCC = ?????

    3.) Get List/Collection of All Workspaces that exist

    4.) Get List/Collection of All Open Workspaces


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

    #2
    Hello -=Edge=-,

    For question 1 I am not too sure about this and I am still researching. However, you may find what you are looking for in NinjaTrader.Core.Globals.AtiOptions.

    What are you trying to accomplish?

    For question 2:
    Code:
    NinjaTrader.Core.Globals.MainThreadDispatcher.InvokeAsync(new Action(() =>
    {
    foreach (var window in NinjaTrader.Core.Globals.AllWindows.Where(window => window is ControlCenter))
    {
    Print(window.ToString());
    }
    }));
    For questions 3 & 4:
    Code:
    foreach (string savedWorkspace in NinjaTrader.Gui.Tools.WorkspaceOptions.SavedWorkspaces)
    {
    Print(savedWorkspace);
    if (NinjaTrader.Gui.Tools.WorkspaceOptions.GetActiveWorkspaceFromXml == savedWorkspace)
    Print("this workspace is: " + savedWorkspace);
    }
    Last edited by NinjaTrader_ChelseaB; 03-21-2016, 08:07 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      For question 1 I am not too sure about this and I am still researching. However, you may find what you are looking for in NinjaTrader.Core.Globals.AtiOptions.
      Perfect! Thanks!

      The only reason I was looking for ControlCenter was I'm having some major problems trying to switch between workspaces within code, and just thought I'd try to work around the issues and invoke the methods from there.. But digging a little deeper, turns out I guess you guys aren't using a normal NTMenuItem for either the workspaces or the connections, but rather special MenuItem types, that don't seem to contain normal items and/or automation ids... Was just a thought..

      In NT7 switching to a different workspace (whether it was opened or closed) was an extremely easy process..

      NinjaTrader.Gui.WorkspaceOptions.OpenWorkspace(ws, true);
      NinjaTrader.Gui.WorkspaceOptions.SwitchWorkspace(w s,true);

      This doesn't seem to be the same case in NT8.. Depending on whether the workspace is already opened and/or closed, the order you use to open/close/switch/active, it can leave remnants behind, create duplicate windows, not show the workspace is open and/or active in the controlcenter, throw exceptions, and/or just downright crash..

      I think I have the switching between already opened workspaces figured out. What is the secret sauce to get a closed one (validity already checked) to open, and have ControlCenter to correctly show it's open and active as well?




      Edit: I can email you a code sample if that would help..
      Last edited by -=Edge=-; 08-28-2015, 01:45 PM.
      -=Edge=-
      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

      Comment


        #4
        Additional Interests

        I would like to get a list of "Indicators" that are active on charts and compiled for use. I might need a list of charts to get this, but this would be help to add to this thread.

        Comment


          #5
          Originally posted by NJA_MC View Post
          a list of "Indicators"
          You should be able to obtain this through the <ChartControl>.Indicators collection, but that would relate to a specific chart. You would need to access a ChartControl instance for each open chart if you wanted a workspace-wide collection of indicators.

          http://ninjatrader.com/support/helpG...indicators.htm
          Dave I.NinjaTrader Product Management

          Comment


            #6
            Hello,

            -=Edge=- have you tried
            Code:
            NinjaTrader.Gui.Tools.WorkspaceOptions.OpenWorkspace("WorkspaceName", true);
            Then using the code from post #2 to see if it is active?

            NJA_MC, attached is an example with unsupported code of listing indicators from an addon.
            Attached Files
            Last edited by NinjaTrader_ChelseaB; 08-28-2015, 02:43 PM.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              -=Edge=- have you tried NinjaTrader.Gui.Tools.WorkspaceOptions.OpenWorkspa ce("WorkspaceName", true);
              Then using the code from post #2 to see if it is active?
              Oh yea.. been there, done that, way past all that.. That opens one yes.. but doesn't show it open or active in ControlCenter, ends up duplicating windows, and just doesn't work stand alone.. I'm at the point where I've tried about everything, and think that it might not be my code, but a bug..


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

              Comment


                #8
                Hi -=Edge=-,

                I am able to reproduce the workspace opening not showing in the control center and I have sent a bug report to development about this.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  I am able to reproduce the workspace opening not showing in the control center and I have sent a bug report to development about this.
                  Thanks, but not sure the extent of the problem ends there.. It might, but if you've opened up the workspace from code, switch to another workspace from controlcenter, and then switch back to the code opened workspace from controlcenter.. All the windows in that workspace will be duplicated.. It could all be related, but thought since we're talking about it, I'd mention it.. It would be nice in the end, if all this worked with 2 lines of code just like NT7 did.. but hey, at this point I'll take whatever will work.. heh


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

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChelseaB View Post
                    I am able to reproduce the workspace opening not showing in the control center and I have sent a bug report to development about this.
                    Good Day ChelseaB

                    Just wanted to verify, but can I assume these fixes did not make it into B4, as I still seem to experience the same issues as before?


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

                    Comment


                      #11
                      Originally posted by -=Edge=- View Post
                      Good Day ChelseaB

                      Just wanted to verify, but can I assume these fixes did not make it into B4, as I still seem to experience the same issues as before?


                      We reviewed this with development, and at this time we do not have any supported methods of opening/closing workspaces from NS.

                      Only suggestion would be to dig through the automation stuff.

                      Added direct support is tracked using #SFT-663
                      MatthewNinjaTrader Product Management

                      Comment


                        #12
                        Originally posted by NinjaTrader_Matthew View Post
                        We reviewed this with development, and at this time we do not have any supported methods of opening/closing workspaces from NS.

                        Only suggestion would be to dig through the automation stuff.

                        Added direct support is tracked using #SFT-663

                        Any development on this? I noticed some changes in B10 where I had to rem out some old code in the script I was playing with this in..
                        -=Edge=-
                        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                        Comment


                          #13
                          Hi -=Edge=-,

                          No, at this time SFT-663 has not been implemented.

                          Please let me know if there are any other feature request IDs that you would like the status of.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by ageeholdings, Today, 07:43 AM
                          0 responses
                          7 views
                          0 likes
                          Last Post ageeholdings  
                          Started by pibrew, Today, 06:37 AM
                          0 responses
                          4 views
                          0 likes
                          Last Post pibrew
                          by pibrew
                           
                          Started by rbeckmann05, Yesterday, 06:48 PM
                          1 response
                          14 views
                          0 likes
                          Last Post bltdavid  
                          Started by llanqui, Today, 03:53 AM
                          0 responses
                          6 views
                          0 likes
                          Last Post llanqui
                          by llanqui
                           
                          Started by burtoninlondon, Today, 12:38 AM
                          0 responses
                          12 views
                          0 likes
                          Last Post burtoninlondon  
                          Working...
                          X