Counting Ticks in a minute bar

nm=Minute() != Ref(Minute(), -1);
tk = BarsSince(nm)+1;
Plot(tk,"tk counter",colorBlack);

tic

I tried to count ticks in a minute by above code. It works when i keep time frame in ticks.
I'm trying to get Histogram of ticks in a minute in 1 minute chart.
Due to my very limited knowledge of coding 'm stuck.
Please help me to get that tick count histogram for minute bar

You can not look inside bar from selected 1-minute interval to 1-tick interval.

So instead you may simply store the results to https://www.amibroker.com/guide/afl/addtocomposite.html in 1-tick interval

So e.g. by adding line

// added to 1-tick chart
AddToComposite( tk, "~TickCounter_" + Name(), "X", atcFlagDefaults | atcFlagEnableInIndicator );

Then open another chart and set interval to 1-minute there and call the artificial symbol (e.g. named ~TickCounter_BANKNIFTY-I) via Foreign or SetForeign.

// in 1-minute chart
tk = Foreign("~TickCounter_" + Name(), "C", true);
3 Likes