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

[EquisMetaStock Group] Re: If Then Else Neutral



PureBytes Links

Trading Reference Links

Kevin,

The formula was originally written back in 1999 and posted on the 
Guppy site back in April of 2000. Strange that no one saw the problem 
until now. Maybe a result of the bear market. 

The formula as posted works correctly. It plots either a 3MA high or 
a 3MA low overlaping on the bar at which the close is greater/less 
than " YESTERDAY'S " MA. Notice the use of the ref statement in the 
first line...HLd:=If(CLOSE>Ref(Mov(H,3,S),-1)  So we are indeed 
looking for a close greater that yesterday's MA.

To make the change you want simply change the formula to:  

{Gann HiLo Kevin Modified}
Lb:=Input("Look-Back Periods?",2,80,3);
HLd:=If(CLOSE>Mov(H,Lb,S),
{then}1,
{else}If(CLOSE<Mov(L,Lb,S),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}Mov(H,Lb,S),
{else}Mov(L,Lb,S));
HiLo;{end}

Now you should get a resulting plot of either a 3MA high or 3MA 
low on the bar at which the close is greater/less than the "current" 
MA.


Preston









--- In equismetastock@xxxxxxxxxxxxxxx, Kevin Barry <kevin_barry@xxx> 
wrote:
>
> Hello,
> 
> I am in the process of rewriting the Gann Hi-Lo indicator using as 
my 
> starting point the following formula by Adam Hefner:
> 
> HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),
> {then}1,
> {else}If(CLOSE<Ref(Mov(L,3,S),-1),
> {then}-1,
> {else}0));
> HLv:=ValueWhen(1,HLd<>0,HLd);
> HiLo:=If(HLv=-1,
> {then}Mov(H,3,S),
> {else}Mov(L,3,S));
> HiLo;
> 
> The resulting plot is not quite correct because the 3MA high and 
the 3MA 
> low plots should overlap on the bar at which the close is 
greater/less than 
> the current MA.
> 
> The obvious solution is to create two plots GannHi and GannLo to 
replace 
> the HiLo plot. However, we would need to specify an If statement 
without 
> the ELSE condition.
> 
> We can't write If(HLv=-1,Mov(H,3,S),0) because it doesn't plot 
correctly.
> 
> Any suggestions for creating an equivalent of IF without the need 
to 
> provide an ELSE parameter?
> 
> Many thanks in advance.
> 
> Regards,
> Kevin
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/