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: Support Resistance levels
Author/Uploader: Graham Kavanagh - gkavanagh [at] e-wire.net.au
Date/Time added: 2003-05-22 22:25:51
Origin:
Keywords: Support Resistance
Level: medium
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:

Indicator to show support and resistance levels based on RSI indicator reversals

Formula:

//Support and resistance levels using RSI.
//graham Kavanagh May 2003
//Load into Indicator Builder
//Sensitivity of the levels can be changed with the variables
//Can test different numbers live with the Param function ctrl-R with open
pane
RSIperiod	= 5;	// Param("RSI p",3,14,30,1);
Percent 		= 5;	//	Param("ZIG %",8,9,15,1);
EMAperiod 	= 5;	//Param("EMA p",4,5,10,1);
HHVperiod 	= 5;	//Param("HHV p",3,5,10,1);
NumLine 		= 1;	//Param("Num Lines",3,1,20,1);

Base = DEMA(RSI(RSIperiod),EMAperiod);

GraphXSpace=0.5;
Plot(C,"",colorBlack,styleCandle);

for( i = 1; i <= numline; i++ )
{
ResBase = LastValue(Peak(Base,Percent,i));
SupBase = LastValue(Trough(Base,Percent,i));
Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed,
styleLine);
Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen,
styleLine);
}
Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " +
/*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+
"Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines
="+WriteVal(numline,1) ; 

Comments:

Graham Kavanagh
gkavanagh [at] e-wire.net.au
2003-05-23 20:10:34
Requires latest Betas of AB that allow FOR loops without invoking script in the AFL
Dimitris Tsokakis
tsokakis [at] oneway.gr
2003-05-25 14:48:16
Congratulations for this fresh idea !!
sam
mivzak_online [at] hotmail.com
2003-05-30 09:41:36
it gives me error :
Unknown identifier at line 10, column 9:


RSIperiod
--------^

thanks for your answer
Graham Kavanagh
gkavanagh [at] e-wire.net.au
2003-05-30 18:34:31
If copied direct from the AB AFL site, then the word &#8220;pane&#8221; is placed in a new row, it should be in the line above. Must be something with the way it wordwraps at the site. Just move it to end of previous row
//Can test different numbers live with the Param function ctrl-R with open pane
sam
mivzak_online [at] hotmail.com
2003-05-31 09:30:40
thanks for your time'
afther i do that its give me :
Unknown identifier in line:


for(
---^
what should i do?
Graham Kavanagh
gkavanagh [at] e-wire.net.au
2003-06-02 01:39:14
Sam you need the recent Beta versions with the for loops included.
Otherwise you will need to include the for within a script part in AFL.
David Holzgrefe
dtholz [at] netspace.net.au
2003-06-14 18:33:35
Hmm havent used AB for a while, the crtl R parameter doesnet work current ab version 4,38.0
its shaded out in the right click function ?

What have i missed ?

Thanks David
Daivd

2003-06-14 18:39:02
No to worry found the answer "param "
Daivd

2003-06-14 18:44:22
No to worry found the answer "param "
RSIperiod= 5; Param("RSI p",3,14,30,1);
but the slider doesnt seem to change the plot ?
Graham
gkavanagh [at] e-wire.net.au
2003-09-13 07:05:56
David, Line should read :
RSIperiod= Param("RSI p",3,14,30,1);
Glen Bremner-Stokes
bremner [at] uk.ibm.com
2006-03-24 15:00:20
Very useful. Well done.
Mike Mann
m3m [at] earthlink.net
2006-04-04 11:48:57
Is there an easy way to plot these levels from Daily calculation on an intraday chart?
Savio
softnews2003 [at] yahoo.com
2006-09-16 15:07:41
Hi,

Please is there any one can help in filtering price cross ResBase line?

Thanks to all


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