I need an indicator that will recognize if a specified number of consecutive candles are the same color and give me an alert if they are.
There will only be one input which will be the number of consecutive candles to monitor. Therefore, if I specify three candles, as soon as the last three completed candles are the same color. I should get an alert. The same is true for 4, 5, 6 etc candles as specified in the input.
To code this, you should use indexing from the current candle to make sure get the closing prices for the specified number of candles.
For example, if I specify 5 candles. the current open candle has an index of , the code should therefore check if the closing prices for candles of the indexes below are as per the condition below for a bullish alert:
 >  and  >  and  >  and  > .
the reverse is true for a bearish alert if 5 candles have been specified:
 <  and  <  and  <  and  < .
Also, an arrow should be printed if the candle in index , the current open candle closes whilst the condition is true. This arrow should be printed underneath the candle  which has just closed to become candle 
this computation should always be calculated from the current open candle.
I also need the indicator to print the total number of point moved by the consecutive candles from the opening of the first candle to the close of the last candle. this should be printed of the top right corner of the chart, this should be the most recent computation.
The indicator should work the same way for candles in every timeframe.