Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Select Folder User Input

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

    Select Folder User Input

    Hi,

    I would like to have in my strategy inputs an option to select a folder (path) as destination of some files.

    I found out that this is possible for files selection as below:

    [NinjaScriptProperty] [Display(Name="MyFilePath", Order=1, GroupName="Parameters")] [PropertyEditor("NinjaTrader.Gui.Tools.FilePathPick er", Filter="Any Files (*.*)|*.*)", Title="Sound")] public string MyFilePath { get; set; }

    Is it possible to achieve the same behaviour for folders selection?

    Thanks & Regards.

    #2
    Hello Peppo,

    Thank you for the post.

    I am not aware of any kind of built in folder picker that could be used. For this you would likely need to create your own file picker and then leverage one of C#'s normal directory pickers. You can see an example of creating a file picker that opens a window in the following post. Instead of opening a window you could do an action like pick a directory, when the return comes back from the picking of the directory you could supply that as the success shown in the example. https://ninjatrader.com/support/foru...222#post806222

    Please let me know if I may be of additional assistance.

    Comment


      #3
      Hi Jesse,

      thank you for your input.

      I tried out your solution but I didn't find better solution than this one for the PropertyEditor:

      System.Windows.Forms.FolderBrowserDialog openFolderDialog = new System.Windows.Forms.FolderBrowserDialog();

      This is not really what I was looking for. I would like to be able to navigate and then have a "Select Folder" button like.

      Do you have any suggestion on how to acomplish that?

      Thakn you.

      Regards.

      Comment


        #4
        Hello Peppo,

        That would generally be how you access a folder picker in C#, what was the reason that did not work for you? You could rename the ... button in that sample to have text like Select Folder if you wanted to. The FolderBrowserDialog could then be used to select a folder and produce a path which is returned to the property.

        I otherwise don't know of any other options for the folder picker however you can search online for any C# based way to pick folders and use that.

        I look forward to being of further assistance.

        Comment


          #5
          Use case: create a public variable in the Properties section so when the user clicks on the dialogue box in the indicator configuration window, they can navigate to a desired folder location, and this returns the full path of the folder they selected.​ After conferring with NinjaTrader support, they confirmed there is no

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          51 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          128 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X