Counting the number of candles

Hi

I want to write a code for counting the number of candles, irrespective of the time frame, during intraday,
I request help in this regard. Can somebody help.

Thanks in advance.
Soma Raju