[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] RSI -Last 5 highest values of the last 200 bars.



PureBytes Links

Trading Reference Links

I read this on the message board but what do I add to the AFL code 
that it also looks at the lowest low 5 values  of the 200 bars.

Could anyone tell me what to add so it looks at the lowest 5 RSI 
values  together with the last 5 highest values of the 200 bars.?
I'm be using the 50% mark as the zero mark of the RSI.

Comments with AFL code:
/*

Since we paint the top 10 points Outside the loop execution, we know 
all the rest details, when it happened, the respected value, Outside 
the loop, 
consequently the result is ready for any further use.
The trick was to find the Highest value, find the bar it happens AND 
then, in the very next step, make this value negative [-10 in the 
example]. 
The next cycle of the loop will search for the 2nd Highest value etc.
for other indicators, replace -10 with another, enough negative 
value, lower than the usual indicator values, to ensure that you 
will excude this
bar from the next cycle of the loop. if you do NOT know the negative 
values, a Lowest(Indicator)-1 is enough.
*/

// Top 5 from 200
R=RSI();
L0=RSI();
L1=LastValue(Cum(1));
N=200;// the lookback period
TOP=5;// the topX calibration
for(K=1;K<=TOP;K++)
{
H1=LastValue(HHV(L0,n));
BAR1=LastValue((ValueWhen(L0==H1,Cum(1)-1)));
L0[BAR1]=-10;
}
Plot(IIf(Cum(1)>L1-N,R,-1E10),"",IIf(L0==-10,colorRed,colorBlack),2);

 Title = Name()+"   "+FullName()+
"  RSI Count=200  Last 5 High = Red (Sell Zone)";




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy quality ink cartridges & refill kit. Remanufactured & Refills for:
HP $8-20, Epson $3-9, Canon $5-15. FREE shipping over $50 (US & Canada).
http://www.c1tracking.com/l.asp?cid=6347
http://us.click.yahoo.com/lB7L3D/k5uGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/