Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 love2code2trade, Yesterday, 01:45 PM
          4 responses
          28 views
          0 likes
          Last Post love2code2trade  
          Started by funk10101, Today, 09:43 PM
          0 responses
          7 views
          0 likes
          Last Post funk10101  
          Started by pkefal, 04-11-2024, 07:39 AM
          11 responses
          37 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Yesterday, 08:51 AM
          8 responses
          44 views
          0 likes
          Last Post bill2023  
          Started by yertle, Today, 08:38 AM
          6 responses
          26 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Working...
          X