Hi,
please help me with my script..., my pine skills is still to fresh :)
I have two lines drawn in a MACD indicator. When the lines cross upwards, a green dot appears at that point. When the lines cross downwards, a red dot appears at that point:
plot(crossover(xxxxxx, yyyyy) and barstate.isconfirmed ? circleYPosition : na, style=plot.style_circles, linewidth=6, color=dotColor, title='Dots')
plot(crossunder(xxxxxx, yyyyy) and barstate.isconfirmed ? circleYPosition : na, style=plot.style_circles, linewidth=6, color=dotColor, title='Dots')
I would like to implement the following, but I can't get it programmed correctly:
If the lines intersect upwards (crossover), then I only want the green dot to be displayed if the point is ABOVE the zero-line.
If the lines cross downwards (crossunder), then I only want the red dot to appear if the point is BELOW the zero-line.
Do I have to use the IF command for this? And if so, how do I implement that?
Thanks a lot for help!
Thorsten