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 charlesugo_1, 05-26-2026, 05:03 PM
                  0 responses
                  65 views
                  0 likes
                  Last Post charlesugo_1  
                  Started by DannyP96, 05-18-2026, 02:38 PM
                  1 response
                  149 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 05-11-2026, 05:56 AM
                  0 responses
                  162 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CarlTrading, 05-10-2026, 08:12 PM
                  0 responses
                  99 views
                  0 likes
                  Last Post CarlTrading  
                  Started by Hwop38, 05-04-2026, 07:02 PM
                  0 responses
                  286 views
                  0 likes
                  Last Post Hwop38
                  by Hwop38
                   
                  Working...
                  X