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 DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X