It might make sense to model the transaction as it's own node for more involved querying/operations.
get the most popular stock and use it's time as the median to filter other purchases by
WHERE abs(popularBuy.timestamp - buy.timestamp) < X
or
WHERE popularBuy.timestamp - duration('3D') < buy.timestamp < popularBuy.timestamp + duration('3D')
compute the delta between last and first month as duration
starting from first month add a duration of +1 for each month
create a boolean list with true, false for each month and then a reduce that computes the running totals
reduce(result=[0,0], x in bought | case when x then [result[0], result[1]+1] else case result[1] > result[0] then [result[1],0] else [result[0],0] end)
and then result[0] has your highest consecutive
you can of course also combine that into one operation
alternatively compute the "has bought previous month" and aggregate them e.g. on the min or max month of consecutive purchases