Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Double to String

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

    Double to String

    Hello

    I have a double called stopsell which I want to convert to a string and draw on the chart as below:-

    DrawTextFixed("LondonSell", String(stopsell), TextPosition.TopRight);

    However this wont work, is it possible and if so what is the code?

    Thank you.

    #2
    To change something to a string you would go like this:

    stopsell.ToString()
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you

      Can I also change the color and font size?

      Comment


        #4
        Please use the more expanded overload method if you wish to do so.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I'm not sure I'm understang the syntax correctly

          DrawTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color backColor, int opacity)

          If I use :-
          DrawTextFixed("UsSell", "Sell Stop " + stopsell.ToString() + " @ £" + size.ToString(), TextPosition.TopRight, Color.Red); I get an error No Overload

          I would also like to be able to set a font size?

          Comment


            #6
            You have to use the WHOLE method, not bits and pieces. You need to fill out every single parameter.

            You choose Font size in the Font parameter.
            new Font("Arial", 12)
            for instance.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              This is now my line but it does not like the "Font"

              DrawTextFixed("UsSell", "Sell Stop " + stopsell.ToString() + " @ £" + size.ToString(), TextPosition.TopRight, Color.Red, Font("Arial", 12), Color.Red, Color.Transparent, 5);

              Tells me that System.Drawing.Font is a type but is used like a variable?

              Comment


                #8
                new Font("Arial", 12)
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Got it thanks.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  650 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  574 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  577 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X