it's funny you ask because one of the default boxes that comes with tradelink is a grey box that will exit a position at a certain moving average target.
The software is free and it works with IB out of the box...
The example box you want is called GreyBox. To use it after installing the software, open ASP, click box library and open box.dll. Select GreyBox. Appy it to a stock and you should get a popup asking you what percentage of the trade it should exit when a moving average is crossed.
Here is the code for the box to give you an idea what it does :
There are some Metatrader Auto Trading modules I found online at www.fxalgotrading.com -
They've got some sort of Auto Trendline trading system and also a handy pivot program which you automatically calculates and displays the pivots on the loaded chart.