help preventing a gridtrading system from a margin call, anyone?

 
Anyone who knows how to put protective buys or sells on the outside of a grid?

let's assume a grid is placed between 10 and 20, then I would like the EA to place one pending sell order at 8 and one buy at 12 that will equal 75-100% of outstanding lots, as a hedge. Is that possible?

If that is possible then it would be interesting to find some smart closing strategy. Thankful for any answer.

/Patrik