Thanks jcl. This has spawned some other thoughts:

I gather, then, that 1 isn't specifically called out in the code - it's just that 1% (or other small %) of the profit normally calculates close enough to 0 that the result is the stop being at entry?

Is this also taking into account Spread, etc.? I.e., in the example of 10 pips, that's 10 pips after costs, yes? And the TrailLock stop is placed at entry+costs+8pips?

Also, is TrailLock a one-time thing or is it re-evaluated at every tick/bar? In the example, if profit subsequently increased to 20 pips, would the TrailLock stop be moved up to 16 pips?

Thanks.

P.S. - Does it work for TrailLock >100? Can I "lock" >100% of my profit?! laugh