Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FormatPriceMarker embellishments?

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

    FormatPriceMarker embellishments?

    I finally figured out FormatPriceMarker so that my indicators spit out the full number instead of the pre-determined NinjaTrader abbreviations (eg. 32M)

    But if I wanted my indicator to spit out my own abbreviations, how would I do that? eg. I have an indicator that spits out 0.3215. I want the display in my market analyzer to show 32%

    I can get it to show 32 by multiplying the indicator result by 100, then using FormatPriceMarker with return price.ToString("N0");

    I tried return price.ToString("N0" + "%"); but that doesn't work.

    #2
    Hello pretender,

    Thank you for your inquiry.

    Here's an example of what you could do:
    Code:
    protected override string FormatPriceMarket(double price)
    {
         string thePrice = price.ToString("N0");
         return thePrice + "%";
    }
    This will return thePrice string with a % appended to it.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by pretender View Post
      I finally figured out FormatPriceMarker so that my indicators spit out the full number instead of the pre-determined NinjaTrader abbreviations (eg. 32M)

      But if I wanted my indicator to spit out my own abbreviations, how would I do that? eg. I have an indicator that spits out 0.3215. I want the display in my market analyzer to show 32%

      I can get it to show 32 by multiplying the indicator result by 100, then using FormatPriceMarker with return price.ToString("N0");

      I tried return price.ToString("N0" + "%"); but that doesn't work.
      There is a specific overload to display a string conversion as a percentage: ToString("P").
      Last edited by koganam; 01-11-2016, 03:38 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      76 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      45 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      26 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      62 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X