Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add OpenFileDialog to Indicator

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

    Add OpenFileDialog to Indicator

    Click to get Open File dialog window
    How do I add that open file dialog box to an NT8 indicator?

    #2
    Hello habibalex,

    Thanks for your post.

    In NT8 you would need to use a property editor. Here is an example that will provide a field in the UI that will display the default sound file (that you assign in State.SetDefaults) and if you move the mouse over property, the field will then show "Choose file". When you left click on the field, a standard windows explorer will open to the sounds folder.

    [Display(Name="CrossAbove sound", Description="Enter Up sound file path/name", Order=2, GroupName="Cross Detection Actions")]
    [PropertyEditor("NinjaTrader.Gui.Tools.FilePathPick er", Filter="Wav Files (*.wav)|*.wav")]
    public string UpSoundFile
    { get; set; }


    For your convenience, I have attached the file SamplePropertyEditorforFiles.zip that will demonstrate.


    SamplePropertyEditorforFiles.zip

    Comment


      #3
      Hello PaulH, great example, thank You.
      Is there a similar way to choose folder?
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        Thanks for your post.

        If you change the filter from Filter="Wav Files (*.wav)|*.wav") to Filter=""), does that meet your needs?

        Comment


          #5
          Sorry, it not works:
          1. Not showing default value in grid property.
          2. Dialog still shows "File name".
          3. If to remove "File name" - no reaction when clicking OK button.

          Here is a brief video: https://www.screencast.com/t/Uljk251f

          I did exactly this:
          PHP Code:
          [NinjaScriptProperty]
          [Display(GroupName="03. Use_ML",  Order=1)]
          [PropertyEditor ("NinjaTrader.Gui.Tools.FilePathPicker" , Filter= "" )]
          public string MlDataFilePath  { get ; set ; } 
          
          Attached Files
          Last edited by fx.practic; 01-24-2019, 01:39 PM.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello fx.practic,

            Thanks for your reply and for testing that.

            I don't have an answer for you on a folder picker property editor.

            If I run across something I will post it here.

            Comment


              #7
              Will be waiting, thank You.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment

              Latest Posts

              Collapse

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