Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I want to write data to a file

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

    I want to write data to a file

    Hi everyone.

    I would like to know how I can get the NinjaTrader environment variable to determine the folder where my indicator is installed, so that I can save data (create a file, write it and read it) to that same folder.

    Thanks in advance.

    #2
    Hello trader2022ne,

    I would not recommend that you write in the NinjaTrader Environment folder, and instead write to your own folder which could be located in Documents.

    That said, below is a link to the reference sample on using StreamWriter in the help guide.


    The NinjaTrader.Core.Globals.UserDataDir is the NinjaTrader Environment folder.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello NinjaTrader_ChelseaB​,

      Just out of curiosity, why is it not recommended to write in the folder where the indicator is installed inside the NinjaTrader folder?

      Thank you.

      Comment


        #4
        Hello trader2022ne,

        Clutter and bloat especially when making backups. I generally advise not to put any files anywhere in the environment folder except for in the templates folder.
        And if it's something large being written, put this a folder outside of the environment folder.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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