attn "Joris M.schuller" <
jmschuller@xxxxxxxx net>
attn droskill
The following code by Don Lindberg has some looping ewrror
kindly correct and post correct code
============ ========= ========= ========= ========= ====
//Don Lindberg
//Subject: RE: [amibroker] graham Kavanagh Support AND resistance usingRSI.
//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 Openpane
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) ;
}
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( );
============ ========= ========= ========
THANKS IN ADVANCE TO ALL FOR HELP