Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cbi.Core.UserDataDir difference?

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

    Cbi.Core.UserDataDir difference?

    Here is a variable I defined in an indicator:

    private string matrixOutFolder = Cbi.Core.UserDataDir.ToString() + "ptt\\matrix";

    The value for this variable on my computer is:

    C:\Documents and Settings\User\My Documents\NinjaTrader 7\ptt\matrix\

    Here is a variable I defined in a strategy:

    private string matrixInFolder = Cbi.Core.UserDataDir.ToString() + "ptt\\matrix";

    The value for this variable on my computer is:

    D:\My Documents\NinjaTrader 7\ptt\matrix

    How can the same variable on the same computer on the same chart be different??

    Bryan

    #2
    a) Unfortunately UserDataDir is not documented NinjaScript. Thus it may or may not work for you.
    b) You needed to raise this question to Microsoft as what you reported if basically what is returned by the .NET framework (Environment.GetFolderPath(Environment.SpecialFold er.Personal)). NT does not add any logic there.
    c) at the end of the day it likely does not matter since both values point to the same physical directory.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      a) Unfortunately UserDataDir is not documented NinjaScript. Thus it may or may not work for you.
      b) You needed to raise this question to Microsoft as what you reported if basically what is returned by the .NET framework (Environment.GetFolderPath(Environment.SpecialFold er.Personal)). NT does not add any logic there.
      c) at the end of the day it likely does not matter since both values point to the same physical directory.
      Actually, both values point to different physical directories, which is why I asked the question. One points to a directory on the C: drive and one points to a directory on the D: drive.

      Is there any NT or other variable that I can use to point to the NinjaTrader install folder, i.e. MyDocuments\NinjaTrader 7? This is crucial for our 'matrix' technology to work correctly.

      Thanks, Dierk!

      Comment


        #4
        Sorry, I'm not aware of a different way since our code just relies on the .NET feature I mentioned in my post below.

        Comment


          #5
          Ugh... that's bad. I cannot debug this code because it gets compiled into your runtime DLL. So can you maybe help me figure out a way to reference a physical folder using internal variables?

          Comment


            #6
            Unfortunately this is beyond what we provide support for and I would not even know where to start, since apparently the .NET runtime behave irregularity on your machine (Environment.GetFolderPath(..) logic not working as expected).

            Comment


              #7
              OK, thank you. I think I will play with the Environment.GetFolderPath() to see if I can get it to work.

              Bryan

              Comment


                #8
                Dierk, when NT is being installed, can you tell me what the default install path is for the user data? How do you build that pathname? Are you using Environment methods or Cbi or System? Can you look in your install code and see how the "MyDocuments\NinjaTrader 7" or "MyDocuments\NinjaTrader 6.5" path is built for me?

                Thanks!

                Comment


                  #9
                  Hello,

                  This is Brett jumping in here to further assist.

                  The install is done by the installer(Completely separate) not from in the NinjaTrader environment.

                  The installer's Data directory to the My Documents folder path on the PC.

                  The path that is used is the path listed when you right click on the my documents folder and select properties and the location tab, this is the path that is used.

                  As far as how the installer works this is general c#(Or other as the installer in not necessarily c#) programming which is unfortunately outside the level of support we are able to provide.
                  Last edited by NinjaTrader_Brett; 09-27-2010, 07:33 AM.
                  BrettNinjaTrader Product Management

                  Comment


                    #10
                    OK, thanks Brett. I know it's a separate program, but I thought you might be able to see what .NET or System variables you use to create the user data folder. So it must be hard-coded then... that's fine. I'm still looking for a way to determine which folder NT was installed into using some kind of variable. I didn't think this would be so hard to find! ;-)

                    Bryan

                    Comment


                      #11
                      Hello,

                      No problem. This is unsupported. However have you checked this out. Mabye theres something for you here that you can use instead.

                      Gets the path to the system special folder that is identified by the specified enumeration.


                      Specifies enumerated Constant Special Item ID List (CSIDL) values used to retrieve directory paths to system special folders.


                      Also, have you tested this on another PC?
                      BrettNinjaTrader Product Management

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X