ButtonTrader should help you achieve that. They have a built-in trailing stop strategy "Ng Trail1" that should get you started.
But I believe ButtonTrader works only with InteractiveBrokers.
Just a disclaimer - I am a satisfied ButtonTrader customer.