Counting Bar since Last MA Cross Indicator

 

Hi, i've been searching everywhere how to make this kind of indicator. Please see the picture, i really need indicator that can show how many bars since last time MA Cross occured, and displayed in chart.

Is there anyone can help with this?... I really appreciate that.


Thanks.