Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 sidlercom80, 10-28-2023, 08:49 AM
      172 responses
      2,278 views
      0 likes
      Last Post sidlercom80  
      Started by Irukandji, Yesterday, 02:53 AM
      2 responses
      17 views
      0 likes
      Last Post Irukandji  
      Started by adeelshahzad, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post adeelshahzad  
      Started by CortexZenUSA, Today, 12:53 AM
      0 responses
      3 views
      0 likes
      Last Post CortexZenUSA  
      Started by CortexZenUSA, Today, 12:46 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Working...
      X