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 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 ScottWalsh, Today, 06:52 PM
      3 responses
      19 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      17 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      1 view
      0 likes
      Last Post cre8able  
      Started by Haiasi, Today, 06:53 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ScottW, Today, 06:09 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X