Consecutive Candles

 

Hey there


I am trying to find an indicator for MT5 that will alert me when there are x amount of consecutive candles.

for ie.

if candle = bull; then candleUP = 1

if candle = bull; then candleUp = 2

if candle = bull; then candleUp = 3;

if candle = bear then candleUp = 0;(reset) ; candleDown = -1;

if candle = bear then candleDown = -1;


and so on and so on.

and if xCandles = 3(for example) then alert the user.

xCandles is a user input so it can be 3 or even 13 etc.

can anyone help me here, I cant find anything on the forums that helps and the stuff that are there, dont do what I want it too.

also if the open price of the 1st candle is the same as the close price of the previous candle then candleDown and candleUp must be reset