I created an indicator that draws a green horizontal line if the RSI and the current candlestick is bullish and that draws a deep pink horizontal line if the RSI and the current candlestick is bearish. Other criteria include the EMA's, and the Parabolic SAR.
But in the case where I am bullish and there is a green horizontal line, but then the current candlestick turns into a red bearish candle, I would like for the green horizontal line that was drawn on the chart to disappear or to become transparent; instead it usually remains.
The same is true if the RSI drops below 55, or if the EMA setup that triggered the signal has reversed, or if the price goes below the Parabolic SAR. I would like for the green horizontal line that was drawn on the chart to disappear or to become transparent; instead it usually remains.
And the inverse is true for a deep pink horizontal line that has been drawn on the chart and then the current candlestick turns into a green bullish candle, or the RSI, Parabolic SAR, or EMA that triggered the short signal has reversed.
For that behavior, would I add an else if statement to cause the horizontal line to be removed or to become transparent, in those situations?
If so, what code could I use? I'm still new to NinjaScript and to C#.
Screenshot attached regarding the section where I assume I would add an if statement or other code.
Comment