MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Bar Stats by Jose Silva
Displays chart data bar statistics, with multiple output choice.


Bar Stats

{ Data bar statistics v1.0 }
{ Display in own window, then Zoom & Reset }
{ Irregular yearly data bar count indicates
missing data and/or illiquid chart }
{ (c) Copyright 2005 Jose Silva
For personal use only
http://www.metastocktools.com }

{ User inputs }
display:=Input("Count: [1]Year's bars, [2]Years, [3]Bars",1,3,1);
type:=Input("Stats: [1]Individual years', [2]Avg/Total",1,2,1);

{ First year of loaded chart data }
year1:=ValueWhen(1,Cum(1)=1,Year());
year1flag:=Year()=year1;

{ Yearly bar stats }
yStart:=Year()<>Ref(Year(),-1);
yearStart:=yStart OR Cum(IsDefined(yStart))=1;
yearCount:=Cum(yearStart)-1;
yearBars:=BarsSince(yearStart)+1+year1flag;
YearStats:=If(display=1,yearBars,
If(display=2,yearCount,Cum(1)));

{ Total/Avg bar stats }
barCount:=LastValue(Cum(1));
yearCount:=LastValue(Year())-year1;
yearlyAvgBars:=Int(barCount/yearCount+.5);
TotalStats:=If(display=1,yearlyAvgBars,
If(display=2,yearCount,barCount));

{ Plot in own window below price chart }
If(type=1,YearStats,TotalStats)

 

Source / From: TOP
http://www.metastocktools.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!