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

Re: Need Help On If function



PureBytes Links

Trading Reference Links

Neo
The 'If' function is simply a true/false function.
If, as an example, you wanted to know the volume on up days:
If(C>O,V,0)
and you wanted to eliminate the '0' you can simply rewrite the formula as
V*(C>O)
This will give you the same result. The true statement returns a 1. Therefore
multiplication of the true expression by the desired result will give you the
desired result and nothing else.

Jim

neo wrote:

> Bill
>
> I have tried putting both nothing and "" but I get a syntax error. It
> appears that MS is missing a simple If Then function. As stated before, this
> is something the company should correct.
>
> neo
>
> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Bill Irwin
> Sent: Sunday, December 24, 2000 1:48 AM
> To: metastock@xxxxxxxxxxxxx
> Subject: RE: Need Help On If function
>
> But can't the Else be nothing?  I suppose I could answer this question by
> trying it and seeing if I get a syntax error in the formula.  In Excel I use
> "" as the Else option if I don't want to do anything.
>
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of neo
> > Sent: Saturday, December 23, 2000 6:00 PM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: RE: Need Help On If function
> >
> >
> > >>>You mean it won't accept do nothing, as in IF(something is true, do
> > something,)?<<<
> >
> > As far as I can tell MS does not have an If Then function. It
> > only has an If
> > Then Else function. This is something the company should correct.
> >
> >
> >
> > -----Original Message-----
> > From: owner-metastock@xxxxxxxxxxxxx
> > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Bill Irwin
> > Sent: Saturday, December 23, 2000 6:46 PM
> > To: metastock@xxxxxxxxxxxxx
> > Subject: RE: Need Help On If function
> >
> >
> > You mean it won't accept do nothing, as in IF(something is true, do
> > something,)?
> >
> > > -----Original Message-----
> > > From: owner-metastock@xxxxxxxxxxxxx
> > > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of neo
> > > Sent: Saturday, December 23, 2000 4:20 AM
> > > To: metastock@xxxxxxxxxxxxx
> > > Subject: RE: Need Help On If function
> > >
> > >
> > > Yes, this is similar to what I did. The problem was that
> > one color was
> > > always plotting over another color at the 0 line. I ended up
> > > just adding a
> > > null function that is always 0 and plotting it as a wide
> > > light gray for 0. I
> > > plotted this on the chart last.
> > >
> > > It seems the MS should add a plain If, then function to it's
> > > If, then, else.
> > >
> > > neo
> > >
> > >
> > > -----Original Message-----
> > > From: owner-metastock@xxxxxxxxxxxxx
> > > [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of j seed
> > > Sent: Friday, December 22, 2000 3:29 PM
> > > To: metastock@xxxxxxxxxxxxx
> > > Subject: Re: Need Help On If function
> > >
> > >
> > > neo,
> > > This will only work with an oscillator! Place the following
> > > at the end of
> > > your formula and exchange your formula where indicated (not
> > > in brackets):
> > >
> > > A:={YOUR CUSTOM FORMULA HERE};
> > > Green:=If(A>Ref(A,-1),A,0);
> > > Red:=If(A<Ref(A,-1),A,0);
> > > Signal:=Mov(A,5,S);
> > > Signal;
> > > Green;
> > > Red;
> > >
> > > This will give you a red, green, and moving average. If you
> > > do not want the
> > > moving average signal simply leave all signal references out of your
> > > formula. Try placing a dark horizontal line at zero or add 0
> > > to the end of
> > > your formula so that 0 is the last thing plotted.
> > >
> > > J.
> > >
> > >
> > > >From: "neo" <neo1@xxxxxxxxx>
> > > >Reply-To: metastock@xxxxxxxxxxxxx
> > > >To: <metastock@xxxxxxxxxxxxx>
> > > >Subject: Need Help On If function
> > > >Date: Fri, 22 Dec 2000 11:02:45 -0500
> > > >
> > > >I am trying to use the If function to break an indicator in
> > > two so that it
> > > >plots in green if up and red if down. The problem is that I
> > > do not see a
> > > >pure If function. The only one is an If, Then, Else. If I
> > > put a 0 for else
> > > >then I get a color dot there I do not want. Is there
> > > something that could
> > > >be
> > > >put there that would plot no color?
> > > >
> > > >I have thought about creating a null function that would
> > > plot in the same
> > > >color as the background. Is there another way?
> > > >
> > > >neo
> > > >
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > >
> > >
> >
> >