Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          27 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 04-23-2024, 09:53 PM
          2 responses
          49 views
          0 likes
          Last Post wzgy0920  
          Started by Kensonprib, 04-28-2021, 10:11 AM
          5 responses
          193 views
          0 likes
          Last Post Hasadafa  
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,235 views
          0 likes
          Last Post xiinteractive  
          Working...
          X