SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: TechTrader42 who wrote (3841)4/5/1998 7:47:00 PM
From: Bob Jagow  Read Replies (1) | Respond to of 11149
 
Brooke,
Re "Which version is the closest to the original? I think I like 0 to -55
since 0 represents the most recent day and -60 takes us back to the
13th week.",
isn't it a tossup in that -55 fails to test ma10 > ma50 at -60.
If you want an exact match, add a final if to yours
-------
maup:=0;
for i = 0 to -55 step -5 do
ma50:=movavg(i,50,Cl); //use it twice
if movavg(i,10,Cl)> ma50 and
ma50 > movavg(i-5,50,Cl)then
maup:=maup + 2; // 24 max
endif;
next i;
if movavg(-55,50,Cl) > movavg(-60,50,Cl)then
maup:=maup + 1;
endif;
// test for maup = 25
--------
or use my previously posted code
-----------------
maup:=0;
for i = 0 to -60 step -5 do
ma50:=movavg(i,50,Cl); //use it twice
if movavg(i,10,Cl)> ma50 then
maup:=maup + 1; // 13 max
endif;
if ma50 > movavg(i-5,50,Cl)
and i != -60 then
maup:=maup + 1; // 12 max, sum = 25
endif;
next i;
// test for maup = 25
-------------
Haven't checked, but doubt that either would run appreciably slower.

Bob