Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Text at two bars from same signals plus results of first bar

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

    Draw Text at two bars from same signals plus results of first bar

    Hello,
    I am trying to write some code to draw different text results at both bar[5] and bar[2], but currently the text is only drawn at one of the bars, depending on the bars ago value I set for two bool series. The issue is that the code for both the texts is dependant on the same signals from the same bars, bar[0] to bar[6], but in addition, the signal at bar[2] depends on the result at bar[5]. The problem seems to be arising because the results for both bar[5] and bar[2] should arise at the same time, but bar[2] is dependant on the result of bar[5]. When it draws the text result for bar[2], it is correct, indicating that it must have picked up the correct result at bar[5], but the text is not being drawn at bar[5]. Is there some general rule for code in this situation where the later result is also dependant on the earlier one?

    Thank you.

    #2
    Hello GeorgeW,
    Thanks for your post.

    What "tag" are you using for your Draw.Text() ?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response, Josh.
      Your question led me to the solution - the Tags for both bar[5] and bar[2] Draw.Text were the same. I changed one and it now works.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X