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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      581 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      338 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
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X