PureBytes Links
Trading Reference Links
|
Barnes' books are filled with conventional wisdom. Sadly,
we all know that most of the so-called conventional wisdom
just ain't so.
The notion of counting pivot points with an amplitude filter
is one way to follow a trend. But you will not be happy with
the results if you try it.
Barnes says to optimize his parameters for each and every
market. That should have been a flag on the play for me; but
like a darned fool, I bought the stupid book anyway.
It does not stand up well under test. See for yourself with
my code below.
Steve Gibson...
{Barnes Day Trade simpified indicator 6/98 S.Gibson}
{Make plot 1 & 2 histograms}
Inputs: Unit(.125), A3(6);
Vars: NL(0), NH(0), NLctr(0), NHctr(0), LNH(0), LNL(0),
LNLctr(0), LNHctr(0), TR(0);
If Date > Date[1] then begin
NL = close;
NH = close;
LNH = close;
LNL = close;
end;
If Date = Date[1] then begin
{Look for first trend when TR = 0}
If TR = 0 then begin
if close - unit >= NH then begin
NH = close;
LNL = close;
LNLctr = 0;
end;
if close - unit >= LNH then begin
LNH = close;
LNHctr = LNHctr + 1;
if LNHctr >= A3 then TR = 1;
end;
if close + unit <= NL then begin
NL = close;
LNL = close;
LNHctr = 0;
end;
if close + unit <= LNL then begin
LNL = close;
LNLctr = LNL + 1;
If LNLctr >= A3 then TR = -1;
end;
end;
{When in an uptrend. TR = 1}
If TR = 1 then begin
if close - unit >= NH then begin
NH = close;
NHctr = NHctr + 1;
NL = close;
NLctr = 0;
if NHctr >= A3 then TR = 1; {?}
end;
if close + unit <= NL then begin
NL = close;
NLctr = NLctr + 1;
If NLctr >= A3 then TR = -1;
end;
end;
{When in a Downtrend. TR = -1}
If TR = -1 then begin
If close + unit <= NL then begin
NL = close;
NLctr = NLctr + 1;
NH = close;
NHctr = 0;
If NLctr >= A3 then TR = -1; {?}
end;
If close - unit >= NH then begin
NH = close;
NHctr = NHctr + 1;
if NHctr >= A3 then TR = 1;
end;
end;
plot1(0,"");
if TR = 1 then plot2(TR,"");
if TR = -1 then plot3(TR,"");
end;
|