PureBytes Links
Trading Reference Links
|
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
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
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
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|