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 andrewtrades, Today, 04:57 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      3 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X