you could perhaps build on the idea above something like this:
Code:
input long_trail_by = 0.25;
def entry_condition = if your condition then 1 else 0;
def entry_bar_trail = if entry_condition == 1 then LOW else if LOW < entry_bar_low[1] then LOW else entry_bar_low[1];
plot trail_stop = entry_bar_trail - long_trail_by;
The if is a bit more complicated. We keep the first part so that a new entry condition will trigger it at low. Then we ask whether the low from this bar is lower than the entry_bar_trail from the previous bar. if it is, we take the new low, otherwise we keep the entry_bar_trail.
Then we plot some line equal to the entry_bar_trail minus the trail_by value, so that we can see it on the upper chart.
hope that pushes you in the right direction.
-mashume