Dublin_Capital
Member
Can anyone help with coding a study that will draw a horizontal line once a condition is met? To simplify, here is an example:
Once a bar has closed five ticks above the close of the opening bar, draw a horizonal line, starting from the close of the bar that broke the five tick barrier.
I am able to get a horizontal line to draw, but the line moves as soon as another bar closes above the original line. I would like the original line to remain fixed from the point of the bar that met the condition.
My problem is that I am defining a condition that is recalculated on each bar, so it will draw a new one when the condition is met. I can't figure out the language to say "leave the line in place once the condition has been met".
I think the answer is in this post, but I can't figure it out: https://usethinkscript.com/threads/thinkscript-barnumber-function-usage-and-examples.673/
Thanks!
Once a bar has closed five ticks above the close of the opening bar, draw a horizonal line, starting from the close of the bar that broke the five tick barrier.
I am able to get a horizontal line to draw, but the line moves as soon as another bar closes above the original line. I would like the original line to remain fixed from the point of the bar that met the condition.
My problem is that I am defining a condition that is recalculated on each bar, so it will draw a new one when the condition is met. I can't figure out the language to say "leave the line in place once the condition has been met".
I think the answer is in this post, but I can't figure it out: https://usethinkscript.com/threads/thinkscript-barnumber-function-usage-and-examples.673/
Thanks!
Last edited: