How to Setup Custom Indicator

HI… I’ve developed a system… wish to setup an indicator and alert for it… anyone can guide??
The system involves Moving average and commodity index… it is a simple 1 hour chart system… how can I backtest it with metatrade 4 ? any other programs that can backtest system? tq…