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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      57 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      9 views
      0 likes
      Last Post cre8able  
      Working...
      X