Automated Close Help

 
I am new at metatrader 4 and would like to setup a script to close a trade when the RSI and EMA equal. Can anyone help or point me in the right direction ? I would like this on different time frames and currencies. thank you
Reason: