Help with writting an EA in MT4

I would like to know whether someone can help me with introduction to writting an EA in MT4. I do have a little programming experience, but I would like a bit help from the experts.
Let’s say if I want to do the following in an EA.

if sma 5 < current price
and if rsi < 50
sell
else
buy

If I could get the above, it will help me a great deal in learning E programming.