Quote from bwolinsky:
It really surprises me anybody asks about Jack Hershey's methods, and never have a look at the threads about it under my name. Every part of the MACD Stochastic momentum driven indicator is available on Wealth Lab Pro, which is the only platform that has backtested as succesfully as advertised. Have Code, could post, but set for .SPX 5 Minute Bars.
Here is Jack Hershey's Algorithm:
var lbar,bar : integer;
var val1 : integer = 5;
var val2 : integer = 13;
var val3 : integer = 6;
var HersheyStochK2 : integer = StochDSeries(5, 2);
var HersheyStochD2 : integer = SMASeries(HersheyStochK2, 3);
var HersheyStochK : integer = StochDSeries(14, 1);
var HersheyStochD : integer = SMASeries(HersheyStochK, 3);
for Bar := 5 to BarCount - 1 do
begin
if (bar>lbar+2) and (gettime(bar)<1545) then begin
if not (lastpositionactive) and (crossovervalue(bar,HersheyStochK,50) ) and (@#Volume[bar-1]>20000) then begin
{ if (@MACDH[bar]>0) then }buyatmarket(Bar+1,'Jacks friend scott d says to buy here');
end;
if not (lastpositionactive) and (crossundervalue(Bar,HersheyStochK,50)) and (@#Volume[bar-1]>20000) then begin
{ if (@MACDH[bar]<0) then }shortatmarket(Bar+1,'Jacks friend scott d says to sellshort here');
end;
if (positionlong(lastposition)) and (@HersheyStochK[bar]<@HersheyStochD[bar]) and (crossundervalue(Bar,HersheyStochK,80)) then begin
sellatmarket(Bar+1,LastPosition,'');
end;
if (positionshort(lastposition)) and (@HersheyStochK[bar]>@HersheyStochD[bar]) and (crossovervalue(Bar,HersheyStochK,20)) then begin
coveratmarket(Bar+1,lastposition,'');
end;
if (positionlong(lastposition)) and (abs(@HersheyStochD[bar])<1.4) then begin sellatmarket(Bar+1,LastPosition,''); end;
if (positionshort(lastposition)) and (abs(@HersheyStochD[bar])<1.4) then begin coveratmarket(Bar+1,LastPosition,''); end;
if (positionlong(lastposition)) and (lastbar(bar)) then begin sellatclose(Bar,lastposition,'');end;
if (positionshort(lastposition)) and (lastbar(bar)) then begin coveratclose(Bar,lastposition,'');end;
end;
if lastbar(bar) then begin
lbar:=bar;
end;
end;
Note this is in Wealth Lab Developer 4.5, not Pro, use translator to create new updated version.
Is there such script for Ninja Trader?