Hi George I guess you want a non-returning training stop.
This is what I do. Using code I found here and adapted I think:

/*------------------------------------------------
        Input Settings of ATR Trailing Stop
-------------------------------------------------*/
Mx = Param("Trailing Stop X",2.7,1,20,0.1);
Pd = Param("Trailing Stop Periods",21,3,155,1);
StpLvl= Param("Lookback Period - Non
returning ",60,1,236,1); /*Adjust to keep the
stop from dropping past the relevant low*/
/*------------------------------------------------
        Calculation of ATR Trailing Stop
-------------------------------------------------*/
Trail = HHV( C - Mx * ATR(Pd),StpLvl);//ATR Trailing Stop
/*------------------------------------------------
                Plot Stop on Chart
-------------------------------------------------*/
Plot(Trail,"ATR Trailing Stop ", colorYellow,styleThick);
Plot(C,"",colorBlack,styleCandle);


     Perhaps you can adapt it for your stop.

--
Best regards,
Chris









Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS




Reply via email to