can anyone pls help me code this stepMA stoch to give an audio alert when it crosses?

 

i need someone to code this stepMA stoch indicator so it'll give a sound alert when both line crosses each other... i tried the previous stepMA stoch with alert but it seems that it wont work... it'll just paint the arrow only when we refresh the chart and its already too late by that time... so here's the stepMA stoch indicator attached together and also the non working stepMA stoch with alert indicator for everybody to code...lol...

Reason: