[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] IF () statement question



PureBytes Links

Trading Reference Links

Roy/Jay:

I got a response from Metastock. The formula they suggested did not work, but in studing the concept, I found what I thought was a solution: but it lead me to a NEW problem with the IF() function. Perhaps one of you has seen this one.

The concept is this: use nested IF() statements. The IsDefined() function calls another IF() statement if all the data is available, and the nexted IF() statement does the actual math calculations.

Here is a simple example, using Fidelty Select fund FWRLX, which began trading Nov. 3, 2000.

If(IsDefined(Ref(Security("FWRLX",C),-39))>0,If(6>5,4,2,),0)

The IsDefined() function is TRUE 39 weeks after Nov. 3, or about Aug. 3, 2001. It then returns a "1", which is >0, so the nested IF() statement is called. Since 6 is always >5, a "4" is plotted. When the IsDefined() function is FALSE, 0 is NOT >0, so the nested IF() statement is bypassed, and a "0" is plotted.  I charted this, and it works fine. The "0" is plotted as far back in time as when my base security (FSAIX) started trading (about 1993)

But then I tried to take it another step, and substituted a Secutity () function to replace "6>5" in the nested IF() statement. The new formula is as follows:

If(IsDefined(Ref(Security("FWRLX",C),-39))>0,If(Security("FWRLX",C>0,4,2,),0)

Because the nested IF() statement should only be called when the ISDefined() function is TRUE, this formula should always work, because on the dates the IsDefined() is TRUE, the nested IF() statement always contains data. 

But it doesn't work. The "4" is plotted after Aug. 3, 2001, just like the first formula. A "0" is plotted between Nov. 3 2000 and Aug. 3 2001. But NOTHING is plotted before Nov. 3 2000. It appears that Metastock is not completely bypassing the nested If() statement. If that nested If() statement does not have enough data, then the formula does not plot, even though the If() statement should have been bypassed.

I hope you understand why I am trying to convey here. If so, do you know how the Metastock If() statement actually functions?

Harry 



--- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx> wrote:
> Jay
> 
> > I've been following this thread a bit with interest and as I understand
> the
> > problem, if one of several nested IF statement doesn't have supporting
> data or
> > data within the bounds of its individual statement, then MetaStock throws
> out
> > the entire set of IF statements.  If you are looking to see if a work
> around
> > exits, I would expect that MetaStock support could answer your question
> very
> > quickly.  I've received very fast email responses from them on this very
> type of
> > issue.  They answer in less than 24 hours during M-F business days.
> 
> Your suggestion makes sense but I lack your faith in Support being able to
> conjure up a helpful reply for an obvious "screw-up" in another department
> (with feature implementation in 7.0).
> 
> I have more confidence in my own ability to resolve the MS problems, and
> since Equis has already messed up big-time (with Isdefined() etc.) with this
> one, and made no effort over subsequent releases to fix it as far as I can
> see, I have no interest in being fed a spin that conveniently explains it
> all away. I've forgiven Equis for many deficiencies but the one under
> discussion is one that still makes me angry because the solution lies in an
> IsDefined() function that REALLY work instead of just pretending to.
> 
> We know that there are Equis representatives in this group, and one in
> particular is more than happy to tell us about new products, but how often
> have we seen anyone from Equis jump in to assist with MS problems? A few
> members have been kind enough to share helpful responses to their questions
> directed to the Support as you suggest, but ask yourself where you've picked
> up the most useful MS information from.
> 
> Please understand, I'm not criticising your suggestion. Personally I don't
> feel the need to ask for help on this one. I've struggled with many MS
> problems over the last few years, and I've solved a few of the "impossible"
> ones along the way. The solution to managing the N/A problem lies in a
> proper implementation of IsDefined(). End of story. I'm sure Equis have been
> asked to read this chapter of the book but how many years since 7.0 came out
> and the function's as useless as ever.
> 
> Well, I've got that off my chest and I feel much better.
> 
> Roy


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/BefplB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/