This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
Stop-loss Indicator bands
Author/Uploader:
Prakash Shenoi - (email hidden)
Date/Time added:
2008-06-22 11:01:53
Origin:
Based on ATR stops.
Keywords:
Indicator
Level:
basic
Flags:
indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
Simple stop-loss bands calculated by ATR periods (Variable) with highest high and lowest Low value over (variable) the preceding periods. Stop loss level for short positions deduced from highest high value periods and Stop Loss for longs fm Lowest low value periods.
Formula:
/* Stop Loss indicator */
/* AFL code by Prakash Shenoi */
/* Simple stop-loss bands calculated by ATR periods (Variable) with highest
high and lowest Low value
over (variable) the preceding periods. Stop loss level for short positions
deduced from
highest high value periods and Stop Loss for longs fm Lowest low value periods.
*/
pdsshort=Param("pds short",1,10,55);
pdslong=Param("pds long",1,10,55);
Ststop=HHV(H,pdsshort)-ATR(pdsshort);
Lgstop=LLV(L,pdslong)+ ATR(pdslong);
Plot (Close,"Close",colorBlack,styleCandle);
Plot (Ststop," SL for shorts ",colorGreen,styleDots|styleNoLine);
Plot (Lgstop," SL for longs ",colorRed,styleDots|styleNoLine);