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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      43 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      26 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      163 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      158 views
      2 likes
      Last Post CaptainJack  
      Working...
      X