Figure out your short entry criteria.
Set your Buystop = Entryprice * 1.1;
// using a % is not a good idea - ATR(10) or Stdev(C,10) is better on EOD stocks.
If Short is true AND C > Buystop, then Cover
Any decent backtester will carry the above code as active until stopped out or...