I haven't written yet my own EA, but I traded with them and wrote some other programs. So how it's supposed to be in my opinion.
1. Learn the technical analysis.
2. Download and test some of the free EA on your demo account. Try to understand their work.
3. Learn MQ4.
4. Set the goals of trading, conditions and write algorithm of your EA.
5. Write EA.
6. Test it some time on demo account. About 2-3 months, may be. Fix bugs.