I wrote a code for having my momentum indicator be green/red/white when it is sloping up / down / uncertain (with some criteria).
Anyway, I am using 3 different plots, and connecting them by the same code as in the example simple moving average with changing colors somewhere I found in these forums before.
But the thing is, when colors are changing (while the indicator is switching to a new plot), the color of the indicator for the previous bar is also changed to say green from red, along with the current bar - in the connection process.
When colors are constantly changing, it really annoys me even though it is not so important.
I tried not assigning a value to the new plot for the previous bar (differently from the example color change indicator does), but then the previous bar has no plot at all where the color is changing - it is simply empty.
I don't know if there is another way of writing the code so this won't be a problem - if it is, please show me how.
If not possible, I had a different idea: instead of using 3 different plots of different colors, may be I could use only one plot, and then a different indicator to paint each bar - like heiken ashi - but for the indicator's bars instead of the markets bars - Is this possible?
Thank you
Comment