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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        318 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X