Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to DrawText on every Bar

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

    How to DrawText on every Bar

    Hello,

    i want a drawtext on every Bar with a Value.

    How can i do this with this Code:

    Code:
    // Check if we have received a tick on the primary Chart
                if (BarsInProgress == 0 && CurrentBar > 0 && IsFirstTickOfBar)
                {
                    macdValue = macd1.Value[0];
                    macdValue2 = macd1.Value[1];
                    Draw.Text(this, "1" , "T", 1,  Low[0], Brushes.White);}
    ​
    This is want i want but i will not work

    Draw.Text(this, Unique ID (so its not delete on every Bar) , (macdValue-macdValue2).toString, 1, Low[0], Brushes.White);
    Last edited by Dirales; 05-02-2023, 02:15 AM.

    #2
    I Found a way:

    Draw.Text(this, "MacdDiff" + CurrentBar , macdValue3.ToString("N3"), 0, Low[0] -2, Brushes.White);

    Comment


      #3
      Yes, the "tag" parameter of the draw method has to be unique for each bar if you want it to have one on each bar. Any time you Draw with the same tag as before you're telling the indicator to replace the old one with the new one.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        Hello Dirales,

        This is correct, use a unique tag name.

        Below is a link to a forum post that discusses.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        90 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        152 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        80 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        53 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        63 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X