Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

.Draw.Text on historical bar

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

    .Draw.Text on historical bar

    Hi NT,

    Can the Draw.Text method be used to draw something on a historical bar ?
    I.E. if a condition is met on the current bar [0], can I used to above to draw on a bar maybe 2 days ago [2]?

    Or can it only draw on the current bar ?

    Code:
    Draw.Text(this, "Buy.S" + (CurrentBar), true, "" + (counter1 * -1) , 0, Low[0] - ((ATR(2))[0]), 20, Brushes.Lime, new SimpleFont("Arial", 12),TextAlignment.Center,Brushes.Transparent, Brushes.Transparent, 0);
    Thanks

    #2
    Hello akvevo,

    The Draw.Text() method has a barsAgo parameter. This is how many bars ago from the current bar do you want this text drawn on.

    Draw.Text(NinjaScriptBase owner, string tag, string text, int barsAgo, double y)

    Currently, you have this set to 0, which is 0 bars ago, which is the current bar.

    Below is a publicly available link to the help guide on Draw.Text().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      How did i miss that, thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X