Here is the trend line drawing plugin for AmiBroker and AFL code to use it. Instructions are included in a PDF file as well as at the start of each AFL file.
While I think it works reasonably well now (although the backtester is pretty slow), I'll probably keep working on it and updating it here occasionally.
You are free to use it for personal, non-commercial use, and all use is at your own risk. While I haven't had any problems yet, I can't guarantee that there aren't any bugs in the DLL.
Any feedback welcome.