I've developed a plugin DLL for AmiBroker to generate trailing stop plots from any type of data. It calculates a proper trailing stop array from a specified buy date, where the buy date can either come from a portfolio-like file or be passed from the AFL code. With the sample AFL code provided, the latter is used when a date range has been set, making the beginning of the range the buy date.
The DLL also includes a Guppy Count Back Line function to allow that to be used for trailing stops (there's no Count Back entry function though).
The attached ZIP file includes the following files:
GP_Stops.dll - the plugin code
GP_ATRStop.afl - AFL code for an ATR trailing stop indicator
GP_CBStop.afl - AFL code for a Guppy Count Back trailing stop indicator
GP_EMAStop.afl - AFL code for a simple EMA trailing stop indicator
GP Stops DLL.pdf - an instruction sheet
Pfolio1.csv - a sample portfolio file
See the PDF file for instructions.
These files can be freely distributed and modified. The only thing I ask is that if you modify the AFL code and pass it on to someone else, make it clear that it's not my original code by changing the filename or adding a comment to that effect.
Let me know if you have any problems with it or any comments.