Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

number to string

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

    number to string

    I am trying to convert the result of an indicator to a string to print on the chart.

    double myindicatorvalue = Close[0] + High[1];

    I want to insert it into this:

    graphics.DrawString("myindicatorstring", headerFont, headerTitleBrush, 10, yOffset + 120);

    so how do I turn myindicatorvalue into myindicatorstring?

    my indicator is a plot and i tried something like this

    graphics.DrawString(plot.myplot, headerFont, headerTitleBrush, 10, yOffset + 120);

    but NT did not like that. Is there a way to use my plot name?

    Thanks
    Last edited by velocity; 11-28-2009, 09:12 AM.

    #2
    myindicator.ToString()

    or

    myindicator.ToString("###.###") with a format

    Comment


      #3
      I don't quite follow what you are saying.

      myindicatorstring = myindicatorvalue.ToString();

      I tried the above but I don't know if that is what you were referring to.

      Comment


        #4
        Yes, that's correct. The ToString method returns a string version of your double value.

        Comment


          #5
          I got it. Thanks for the help.
          Last edited by velocity; 11-28-2009, 11:08 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          152 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          87 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          131 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          127 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          106 views
          0 likes
          Last Post CarlTrading  
          Working...
          X