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

[amibroker] Re: Counting bars



PureBytes Links

Trading Reference Links

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
--- In amibroker@xxxxxxxxxxxxxxx, "sloughbridge" <sloughbridge@xxxx> 
wrote:
> Hi all,
> 
> I'm trying to build an indicator that will count certain bars, like 
> Up Bars, or 52 Week Highs within a specified lookback.  I want to 
> plot the # of Up Bars in the last 20 bars, or # of 52 Week Highs in 
> the last 10 bars, etc.
> 
> I've read the archives, and tried too many things.  How can I do 
this?
> 
> Thanks!


------------------------ 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/