Help coding an indicator

 

Hi,
Im a total newbie when it comes to programming.

So please if anyone can help , then it would be much appreciated.

I am trying to draw a straight line every time a condition is met.

the condition is  once a candle closes the open of the next candle is compared to the open of the previous candle.
If it is the same then a line is drawn from the previous candle close   (not open ) through the new candle open then continue for up to a distance of at least the next 50 candles.

in the example picture , you see two possible examples.
you see in both A and B  candles numbered 1 and 2

The lines in both cases once the condition is met , starts at candle 1 close  through candle 2 open and then there after to continue  for a predictive 40 candles..

lines to be coloured as per the picture red for down and blue for up.

thanks for any help.

much appreciated.

 

 indi trend line predicter

 
k15hor: Im a total newbie when it comes to programming.
You have only three choices: Search for it (unlikely,) learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Reason: