Hedging Script

 
I am looking for a script that when it is actioned, it will buy and sell the same currency at the same time creating a instant hedge. It would also need to be able to change lot size. example buy 1.0 and sell 1.0 or change to buy 0.1 and sell 0.1 Any help in this matter would be greatly appreciated.