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

[amibroker] Re: Counting bars



PureBytes Links

Trading Reference Links

Let us make something clear : When you write H you mean today's High.
HHV(H,260) is the highest of the last 260 bars, *including* today.
So, it is not possible H to be greater than itself.
I think you search for a new 52-week high, which is a bit different :
cond52_W_high=H==HHV(H,260);
This is the condition for today.
Then you may count the occurrences of this condition the last 20 bars.
Count52_W_high=sum(H==HHV(H,260),20);
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "sloughbridge" <sloughbridge@xxxx> 
wrote:
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> 
> wrote:
> > An Up bar is a condition.
> > A 52-week high is another condition.
> > The # of a condition the last 20 bars is sum(condition,20).
> > Example
> > UpbarCondition=c>ref(c,-1);
> > CountUpbars=sum(UpbarCondition,20);
> > Dimitris Tsokakis
> 
> Hi Dimitris,
> 
> Thanks for the response.  What should the 52-week High condition 
look 
> like?  Not:
> 
> // 52 Hi Count
> H52=H>HHV(H,260);
> H52Count=Sum(H52,10);
> Plot(H52Count,"52HI / 10", 5, 16);
> 
> which gives "0," or other variants I've tried :/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/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/