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 #

Weekly Volume Accumulator by Jose Silva

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From: tan ming <reminiscenostalgia__at__hotmail.com>
To: equismetastock__at__yahoogroups.com <equismetastock__at__yahoogroups.com>
Date: Friday, June 2, 2006, 5:33:59 AM
Subject: [EquisMetaStock Group] Weekly Advance Decline

Anyone knows how to create weekly advance decline as an indicator? When metastock swtiches to weekly view, it uses the last value of the week. This works for normal indicator. However for number of advance and decline issues, it requires the sum of the total advance or decline issues for the entire week and not just the last value. As such the AD view in weekly chart is not accurate.

Tks.
Dan

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From: Jose Silva <josesilva22__at__yahoo.com>
To: equismetastock__at__yahoogroups.com <equismetastock__at__yahoogroups.com>
Date: Friday, June 2, 2006, 8:41:07 AM
Subject: [EquisMetaStock Group] Weekly Volume accumulator (was: Weekly Advance Decline)

Dan, when daily charts are switched over to weekly periodicity, the Monday-Thursday data then becomes inaccessible to normal processing.

On a related note, the code below accumulates Volume/1000 for the week, but only works on daily charts.


Weekly Volume Accumulator

{ Weekly Volume accumulator v1.0
Accumulates & resets Volume at week's start.

CCopyright 2004~2006 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }

{ Data to accumulate - Volume in '000's }
dat:=V/1000;

{ Start data acc - Week's start }
start:=DayOfWeek()<Ref(DayOfWeek(),-1);

{ End data acc - Week's end }
end:=PeakBars(1,-start,1)=0;

{ Start to End flag }
init:=Cum(IsDefined(start+end))=1;
flag:=ValueWhen(1,start-end<>0 OR init,start);

{ Accumulate week's data }
acc:=Cum(flag*dat);
accData:=acc-ValueWhen(1,end,acc);
accData:=accData+end*(Ref(accData,-1)+dat);

{ Plot in own window - daily charts only }
accData



Source / From: TOP
Metastockusers[at]yahoogroups[dot]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!