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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        55 views
        0 likes
        Last Post CarlTrading  
        Working...
        X