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

[amibroker] Highest 10/Lowest 10 from 200 (buy-sell displayed)



PureBytes Links

Trading Reference Links

I would like to add a "buy" and "sell" signal output when the 
highest and lowest bar are being displayed.
with an output number of the highest and lowest number as they are 
being displayed either in the (red bars) positive extremes or the 
(green bars) negative extremes.

I cannot seem to get it to work!
---------------------------------------------------------------
You may see both top10 and bottom10 in the same graph.

// Highest 10/Lowest 10 from 200
R=RSI();
X0=RSI();Y0=RSI();
L1=LastValue(Cum(1));
N=200;// the lookback period
TOP=10;// the topX calibration
for(K=1;K<=TOP;K++)
{
X1=LastValue(HHV(X0,n));
BAR1=LastValue((ValueWhen(X0==X1,Cum(1)-1)));
X0[BAR1]=-10;
Y1=LastValue(LLV(Y0,n));
BAR2=LastValue((ValueWhen(Y0==Y1,Cum(1)-1)));
Y0[BAR2]=110;
}
COLOR=IIf(X0==-10,colorRed,IIf(Y0==110,colorBrightGreen,colorBlack));
Plot(IIf(Cum(1)>L1-N,R,-1E10),"RSI",COLOR,2);

For easier reading select Scaling : Custom min=0, max=100
Dimitris Tsokakis



------------------------ Yahoo! Groups Sponsor ---------------------~-->
ReplayTV: CNet Ranked #1 over Tivo!
Instant Replay & Pause live TV.
Special Sale: 50% off!
http://us.click.yahoo.com/UUMW7B/.5qGAA/ySSFAA/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/