It is useless for backtesting as it stands, as you need to build in that the
previous defined peak or trough has actually occurred on the bar of
interest, ie for Peak you need to add (in words) LowestSince Peak is <=
(100-%) of that Peak value. Any signal between the previous peak and the bar
of where the cross of the % must be ignored.
This is why it only uses Lastvalue and suitable for chart only, or simple
explorations/scans using last bar only.

Also has other problems, like inconsistent sensitivity. The Peak and Trough
use percentage, however because RSI goes between 0 and 100 the percent
change will be more sensitive at the lower values than at the higher. eg 10%
of 10 is 1, 10% of 90 is 9
Far better to create a change based on static amount rather than percentage.

You could I suppose change the definition of support levels of Troughs to
Peaks using 100-RSI to make the sensitivity more equal,
 eg

SupBase = LastValue(Peak(100-Base,Percent,i));

However this only makes it a mirror of sensitivity around 50 value, not same
across the full 0-100 range.


-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com



On 11/11/2007, Grover Yowell <[EMAIL PROTECTED]> wrote:
>
>  Don,
>
>
>
> I got your code to work by changing the filter, as you said.
>
>
>
> But what is your take on the fact that the Zig function is involved so the
> code can look into the future?
>
>
>
> Grover
>
>
>
> *From:* amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Don Lindberg
> *Sent:* Saturday, November 10, 2007 10:12 AM
> *To:* amibroker@yahoogroups.com
> *Subject:* RE: [AmiBroker] graham Kavanagh Support and resistance levels
> using RSI.
>
>
>
> That probably is due to the fact that I set some filters within the code.
> Check the line Filter= and set it to what you want. Read the code.
>
>
>
> Donald F Lindberg
>   ------------------------------
>
> *From:* amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Rasheed Momoh
> *Sent:* Friday, November 09, 2007 6:53 PM
> *To:* amibroker@yahoogroups.com
> *Cc:* [EMAIL PROTECTED]
> *Subject:* RE: [amibroker] graham Kavanagh Support and resistance levels
> using RSI.
>
>
>
> hi
> just wanted to confirm
> 1 when i run the code and click explore. it does not pick the support
> resistance of all the stocks.
> out of 205 stocks it only shows 45.
> kindly assist
>
>
> --- On *Tue, 11/6/07, Rasheed Momoh *wrote:
>
> From: Rasheed Momoh
> Subject: RE: [amibroker] graham Kavanagh Support and resistance levels
> using RSI.
> To: amibroker@yahoogroups.com
> Cc: [EMAIL PROTECTED]
> Date: Tuesday, November 6, 2007, 3:14 PM
>
>
> I have sent an attachment to show u want the support resistance figures r
> generating.
> for example UAC-PROP on the chart is showing a range of 19-21. the formula
> you sent me is showing 42.81-37.73.
> pls what do i do.
>
> abdulrasheed
>
>
> --- On *Tue, 11/6/07, Don Lindberg *wrote:
>
> From: Don Lindberg
> Subject: RE: [amibroker] graham Kavanagh Support and resistance levels
> using RSI.
> To: [EMAIL PROTECTED] ps.com
> Date: Tuesday, November 6, 2007, 2:19 PM
>
> I have put in basic code to allow you to run as exploration. You can
> narrow your search by changing the criteria in the Filter Statement.
>
>
>
> ------------ --------- ------ Begin Code ------------ --------- ---
>
> _SECTION_BEGIN("support and resistant");
>
> //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) ;
>
> *Filter*=*C*>10 *AND* *C*75 *AND* ResBase>=1 *AND* SupBase >=1;
>
> *Buy*=*Sell*=*Short*=*Cover*=0;
>
> *AddColumn*(*C*,"Close",1.2);
>
> *AddColumn*(ResBase,"Resistance",1.2);
>
> *AddColumn*(SupBase,"Support",1.2);
>
>
>
> _SECTION_END();
>
>
>
> ------------ --------- ---- End Code ------------ ---------
>
>
>
> Donald F Lindberg
>   ------------------------------
>
> *From:* [EMAIL PROTECTED] ps.com [mailto: [EMAIL PROTECTED] ps.com ] *On
> Behalf Of *rashmo_70
> *Sent:* Tuesday, November 06, 2007 1:16 PM
> *To:* [EMAIL PROTECTED] ps.com
> *Subject:* [amibroker] graham Kavanagh Support and resistance levels using
> RSI.
>
>
>
> Please is it possible to do a scan on the formula below to generate
> support resistance prices other than browsing each chart?.
>
> thanks.
> _SECTION_BEGIN( "support and resistant");
> //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,"",colorBlac k,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) ;
> _SECTION_END( );
>
>
> ____________ _________ _________ _________ _________ __
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail. yahoo.com
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>   
>

Reply via email to