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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X