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

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Bill Lanius who wrote (8674)2/15/1999 1:02:00 PM
From: unixgeek  Read Replies (2) of 11149
 
I want to find an occurrence of the positive directional
movement(PDM) crossing from below the MDM to above on any day
within the last five days.


There are probably many ways (and I'm sure you'll get many responses)
but here's one possible way.

// I haven't checked this for syntactic correctness,
// but you should get the idea.

integer crossed;
crossed := 0;

integer day;
for day = -4 to 0 step 1 do
if (pdm(day - 1) < mdm(day - 1) and pdm(day) > mdm(day)) then
crossed := 1;
endif;
next day;

if (crossed = 1 and <any other conditions>) then
println symbol;
endif;
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext