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

[amibroker] Ascending/Descending Rank



PureBytes Links

Trading Reference Links




For both Indicator Builder/Automatic Analysis windows, you may 
have in both ascending and descending order the top5
from the last 50 StochD() bars.
 
// Ascending+Descending top5
R= 
StochD();Plot(R,"",colorRed,1);H0=StochD();DesRank=0;AscRank=0;BarsagoDes=0;BarsagoAsc=0;L1=LastValue(Cum(1));N=50;// 
lookback periodTOP=5;// topX 
calibrationCounter=0;Title=Name()+",\n";for(K=1;K<=TOP;K++){H1=LastValue(HHV(H0,n));BAR1=LastValue((ValueWhen(H0==H1,Cum(1)-1)));H0[BAR1]=-10;Counter=Counter+1;DesRank[L1-top-1+CountER]=-H1;BarsagoDes[L1-top-1+Counter]=L1-bar1-1;AscRank[L1-Counter]=-H1;BarsagoAsc[L1-Counter]=L1-bar1-1;shape=IIf(Counter==1,shapeDigit1,IIf(Counter==2 
,shapeDigit2,IIf(Counter==3 ,shapeDigit3,IIf(Counter==4 
,shapeDigit4,shapeDigit5))));PlotShapes((Cum(1)==bar1+1)*shape,Counter,0,Graph0,5);Title=Title+WriteVal(Counter,1.0)+")"+WriteVal(H1)+" 
["+WriteVal(L1-bar1-1,1.0)+"]"+"\n";}Plot((Cum(1)>L1-N)*R,"",(H0==-10)*6+1,2);Plot(AscRank,"",5,2);GraphXSpace=3;Filter=1;// 
select current stock for the last TOP=5 
quotationsSetOption("NoDefaultColumns", True 
);AddTextColumn(Name(),"Name",1.2,colorBlack,colorBlueGrey);AddColumn(Count()-L1+5,"#",1.0);AddColumn(-DesRank,"DesRank",1.3,colorBlack,colorLime);AddColumn(BarsagoDes,"Bars 
ago 
Desc",1.0,colorBlack,colorLime);AddColumn(-AscRank,"AscRank",1.3,colorBlack,colorPink);AddColumn(BarsagoAsc,"Bars 
ago Asc",1.0,colorBlack,colorPink);
 
Dimitris Tsokakis






Yahoo! Groups Sponsor


  ADVERTISEMENT











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 the Yahoo! Terms of Service.



Attachment:
1AscDes.gif

Attachment: Description: "Description: GIF image"