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 PaulMohn, Today, 05:00 AM
      0 responses
      8 views
      0 likes
      Last Post PaulMohn  
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      6 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      17 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      5 views
      0 likes
      Last Post DanielTynera  
      Working...
      X