How to calculate the last 3 Renko bars via code / mq4?

 

Hi,

Title says it all, I need to calculate the last 3 Renko bars (along with their time when bar started) via code / mq4, but I have absolutely no clue how to do that.

Anyone please?

Thanks in advance!