Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

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);

Comments:

Mubashar Virk
mavirk [at] gmail.com
2008-06-24 13:26:32
maybe you want to change:

pdsshort=Param("pds short",1,10,55);
pdslong=Param("pds long",1,10,55);

to:

pdsshort=Param("pds short",10,1,55);
pdslong=Param("pds long",10,1,55);

or

pdsshort=Param("pds short",5,10,55);
pdslong=Param("pds long",5,10,55);

or even

pdsshort=Param("pds short",5,1,10);
pdslong=Param("pds long",10,1,55);
Jack

2008-06-29 05:06:44
Reminder. Stop loss indicator should never go down and this one does.


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM