Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add User Defined Text to an assigned Label (Text String)

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

    Add User Defined Text to an assigned Label (Text String)

    Almost feel like Oliver Twist with these types of questions but they are time-consuming as all get out to find when digging through the library ...

    Objective:

    I have an indicator that plots rectangles and they currently have assigned hard-coded text headers:

    Draw.Text(this, "MyBox"+startDateTime,false, "MyBox name",startDateTime , highestHigh, 12, TextBrush, myFont, TextAlignment.Left,Brushes.Transparent,Brushes.Tra nsparent, 0);



    The string "MyBox name" above I would like to create a user-defined text box in the indicator settings window such that the user can change it to whatever name is desired.

    Clearly this is a 3 step process and I'm hunting down the correct syntax for it. So asking for a library link here.

    Thanx!

    JM

    #2
    Hello johnMoss,

    If you wanted to make a user definable string you would need to make a public string property in the script.

    Code:
    public string MyString {get;set;}

    Comment


      #3
      Got it thanx


      [NinjaScriptProperty]
      [Display(GroupName = "Parameters", Order = 1)]
      public string MyBoxName
      { get; set; }​​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      35 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X