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.
Comment