PureBytes Links
Trading Reference Links
|
Rick,
Instead of using an MA function use SUM with a conditional
expression:
Avg=Sum(UP*(ind>80),period)/Sum(ind>80,period);
I think this works, not sure though.
/Johan
--- In amibroker@xxxxxxxxxxxxxxx, "Rick Parsons" <RickParsons@xxxx>
wrote:
> I have an indicator. If the High of the indicator is > 80 for the
day, I want to:
>
> Calculate: UP = High - Open;
>
> Then I want to calculate a moving average of UP. But I only want
a moving average of UP data when my indicator is > 80. If indicator
for the day is not >80, UP should not be added to the moving average.
>
> How do I do this?
>
> Thanks,
>
>
> Rick
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges & Refill Kits for Your Epson at Myinks.com
Free shipping on orders $50 or more to the US and Canada.
http://www.c1tracking.com/l.asp?cid=5705&lp=home/epson.asp
http://us.click.yahoo.com/brYXfA/_xWGAA/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/
|