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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X