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 CarlTrading, Yesterday, 11:51 AM
      0 responses
      17 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, Yesterday, 11:48 AM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-25-2026, 09:53 PM
      0 responses
      17 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 03-25-2026, 09:51 PM
      0 responses
      13 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 03-23-2026, 11:13 AM
      0 responses
      20 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X