need a script

 
hello i need a script to do the following...
if the price close above or below value X then open a long or short position wtth stop loss value Y with profit target YY
Regardz and thanks
HB