new and need help

 
I want to write a EA that uses moving averages cross Slow being the 5 period Fast being the 3 period the EA will check the if the fast ma is above the slow on the previous price bar close all open orders go long one mini place TSL 50 pips when MA's cross again close all trades and go short I think that just about covers it if I can compound my positions that would be great this is meant to work on the 5min chart cad/jpy and Euro/USD Thank you Ezra
 

See the sample EA that comes with MetaTrader

-BB-