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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      232 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      150 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      161 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      243 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      198 views
      0 likes
      Last Post CarlTrading  
      Working...
      X