Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

User Defined Text Inputs for Ninja 7

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

    User Defined Text Inputs for Ninja 7

    I'd like to be able to input different sound file names for the alerts when I use an indicator with different timeframes and symbols. I was able to find some information here:



    But it doesn't describe how to write the script with text inputs, only number inputs. What sort of modifications would I need to create user defined text inputs?

    #2
    Hello TrendTracker,

    Thank you for your note.

    To create user defined text inputs you could use the strategy wizard via Control Panel>Tools>New NInjaScript>Strategy. Hit next twice and you’ll have the option to define User Defined Variables. On this page you’ll select String under the Type drop down, then put in a default name such as a sound file path. You could either now unlock the code and you’ll see the code you need to add to your script (see Link below too) or you could continue to build the strategy, setting the condition and then having that condition, when true, play a sound (pick any sound file for now). Then unlock the code, you’ll replace the filename in PlaySound( <file name>) with the user defined input you named earlier. This will give you the ability to choose the file name when applying your indicator or strategy.

    I’ve attached a link to a forum post detailing the code you would need to add as well as a screen shot of a strategy I just created which will play the sound path you enter when applying the strategy.

    Support for the development of custom automated trading strategies using NinjaScript.


    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Wow - thank you very much for such a speedy and complete answer. I won't be able to work on it until this weekend, but I don't see having any problems given such a detailed response. Thank you again.

      Comment

      Latest Posts

      Collapse

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