Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator value in full number

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

    indicator value in full number

    Hi support-Team,

    with the support of bertrand, i use the folowing code in my indicator:

    DrawTextFixed("tag", "ê", TextPosition.TopLeft, Color.Red, new Font("Wingdings", 20), Color.Transparent, Color.Transparent, 0);

    DrawTextFixed("DEFalert"," since "+(CurrentBar-BarAtLastCross)+" Bars down - Value: "+(def),TextPosition.TopLeft, Color.Red, new Font("Arial", 12), Color.Transparent, Color.Transparent, 0);

    It shows an arrow and Text in my chart. At the end it shows a value +(def) from the indicator (56,1458965236587 for example).

    now i´m interested in two options:

    - show the value roundet to a full number (56 for example)
    - show the number in bigger letters, if it goes under 20 or over -20 in respect to zero

    Thanks for our Help!

    Pullbacktrader

    #2
    Pullbacktrader, for the rounding part you can use Math.Round from C#, so for example

    Math.Round(def, 2) would round it to 2 digits.

    Further, here's an example how you could dynamically update the second DrawTextFixed according to a custom condition -

    Code:
    if (ADX(14)[0] > 20)
    {
    	RemoveDrawObject("tag2");
    	DrawTextFixed("tag2", Math.Round(ADX(14)[0], 2).ToString(), TextPosition.TopLeft, Color.Red, new Font("Arial", 12), Color.Transparent, Color.Transparent, 0);
    }
    			
    if (ADX(14)[0] < 20)
    {
    	RemoveDrawObject("tag2");
    	DrawTextFixed("tag2", Math.Round(ADX(14)[0], 2).ToString(), TextPosition.TopLeft, Color.Red, new Font("Arial", 6), Color.Transparent, Color.Transparent, 0);
    }

    Comment


      #3
      Wow, thank´s for your Help Bertrand! It works.

      Have a nice Day!

      Comment


        #4
        Glad to hear, have a nice day, too!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        37 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        23 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        152 views
        2 likes
        Last Post CaptainJack  
        Working...
        X