Hello Preston,
Many thanks for your reply.
Unfortunately,
this formula still doesn't do the trick as it just shifts the original plot
back a bar. The principle is correct when using the Gann HiLo Activator for
intraday trading but for trading daily bars, the plot must be offset by one
bar (according to Gann).
On the bar on which the trend direction
changes, i.e. where the close is above/below the 3MA high/low, the plots
should overlap, i.e. there should be BOTH a Mov(H,3,S) AND a Mov(L,3,S)
plotted, not one or the other, which is the result of
HiLo:=If(HLv=-1,Mov(H,Lb,S),Mov(L,Lb,S)).
The reason
being is that when trading the Gann System, and a long trade is taken on,
say, a close above Mov(H,3,S), the initial stop is a break below Mov(L,3,S).
That is why we need the plots overlapping on that bar. The If statement as
it stands gives us an either/or.
Once again, I really appreciate your
input.
Regards,
Kevin
At 05:28 PM 2/14/2009 Saturday,
you wrote:
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@yahoogroups.com,
Kevin Barry <kevin_barry@...>
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
>