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 Timing Code by Roy Larsen

From: ruagoodp <almutwinter[at]>
To: Metastockusers[at] <Metastockusers[at]>
Date: Sunday, May 22, 2005, 12:31:37 PM
Subject: [Metastockusers] Weekly Indicator needed

Hi Roy,

Could this daily formula be converted into a weekly formula?
Hope you can help...

Bsetup:=Sum(C<Ref(C,-4),9)=9 AND
Ref(C,-9) >= Ref(C,-13);
BCD:=HighestSince(1,Peak(1,Bsetup,.001),(C<=Ref(L,-2)) + PREV);
BUY:=BCD-ValueWhen(1,Bsetup,BCD)=13 AND



From: Roy Larsen <rlarsen[at]>
To: Metastockusers[at] <Metastockusers[at]>
Date: Monday, May 23, 2005, 12:44:08 AM
Subject: [Metastockusers] Weekly Indicator needed

Hi Norman

Try this. I'm not sure that I've treated the Peak() function correctly, bit it appears to just be operating as an Init or IsDefined() function. I've only tested it on one chart and the 6 hits all tally. Hope this is of some help. The weekly timing code could be made much simpler using Peak() with DayofWeek() but the timing could be less accurate in the event of missing data bars.

This formula need "Calendar Week Counter" indicator.

Weekly Timing Code

{2005 Roy Larsen,}
{for use on daily charts with Jose Silva's "Calendar Week counter"}

F:=Input("End of Week, 5=Friday 6=Saturday 7=Sunday",5,7,5);
Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,0);

{0=Display, update on Friday when possible}
{1=Display, update on each new bar}
{2=Backtest, update on first bar of new week}

I:=Fml("Calendar Week counter");
I:={Abs}(I-ValueWhen(2-G,1,I)); M:=G OR I>0;
F:=G OR (DayOfWeek()=F AND I=0);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
Bsetup:=(Bsetup-ValueWhen(10,J>0,Bsetup))=9 AND
Buy AND ValueWhen(2,J,Buy)=0;


Kind regards



From: ruagoodp <almutwinter[at]>
To: Metastockusers[at] <Metastockusers[at]>
Date: Monday, May 23, 2005, 3:30:08 AM
Subject: [Metastockusers] Re: Weekly Indicator needed

Hi Roy,

Thanks very much for that Roy. It works perfectly.


Source / From: TOP

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!