This snippet counts how many tick updates have occurred for the current bar by incrementing a per-bar counter on each last-bar update. It helps you measure intra-bar activity (“how many ticks built this bar”) on both tick charts and classic time-based charts.
if not isset($ticks[barindex]) then
$ticks[barindex] = 0
endif
if islastbarupdate then
$ticks[barindex]=$ticks[barindex]+1
endif
return $ticks[barindex] coloured(0,255,255) style(histogram)
Check out this related content for more information:
https://www.prorealcode.com/topic/does-prorealcode-the-function-of-getaggregationperiod/#post-258169
Visit Link