Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get the label of an indicator WITH it's quotation marks

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

    Get the label of an indicator WITH it's quotation marks

    Hi
    Here's a weird one that I cannot resolve.
    I have an indicator that I Label "Sw" - to stop all of the parameters spewing across the top of my screen.

    I have a button that can Toggle any indicator between a Visible and an Invisible state. ( I put this on the EcoSystem if anyone is interested)
    In trying to update it I have come across a small issue.

    I Use a key combo with my button click, like so
    Code:
            if(Keyboard.IsKeyDown(Key.LeftAlt))
            {
                str1 = "Sw";​
    }
    this works absolutely fine with drawings or any indicator WITHOUT quotation marks.
    So if I label my indicator Sw - it toggles it's visibility state with no issues.
    I can't work out a way to get "Sw" into my string str1, as a text with the quotation marks included.

    anyone know a way I could acheive this?

    thanks
    Click image for larger version

Name:	sw.png
Views:	141
Size:	19.4 KB
ID:	1319255

    #2
    Hello Mindset,

    Escape the quotation mark in the string.

    Below is a link to a 3rd party educational site on C#.
    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


    "∖"Sw∖""​
    or

    @""Sw""
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea
      FYI @ did not work but the other escape code did.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      556 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X