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: Craig DeHaan who wrote (7298)10/20/1998 9:44:00 PM
From: Bob Jagow   of 11149
 
That was supposed to be "its rather unlikely that the vol [will] increase for 14 consecutive days" -- ie that there will be no negMF.

Wilder does his patently wrong 'throw one out' approx to the EMA for all his indicators so you would use 2n-1 'days' for a real EMA instead of his n (27 instead of 14). MS does that for ADR etc, but may have drawn the line at MFI.

Your solution was fine since vol can't change by less than 1, but can give an exact solution for this particular case, recognizing that you are printing MFI:8:4 and that 100 -100/(1+ PosMF/NegMF) will print as
100.0000 if 100/(1+ PosMF/NegMF) < 5*10^-6.
Therefore, to get the correct answer w/o a div by 0, use
----------------------
if NegMF < 5*10-8*PosMF then
MFI:= 100.0;
else
MFI:= 100 -100/(1+ PosMF/NegMF);
endif;
println ...;
--------------------
TrivialBob
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext