Appreciate your dedication to consistently post your adventures.
I am new to the Hershey method and am trying to understand it. Question for you: I understand that the higher the "rank" value, the more stronger or frequent the stock moves. Can you pls explain what "score" means and whether there is a correlation using both scores to provide better entry/winning trades? i.e. can the sum total provide the entry/exit signals?
I have attempted to alter a chartscript written by you and other people so that the "in dry up" alert shows up with the "score" (my next attempt is to add "ranking" with it) Here it is:
var mo1, mo2, mo3, mo4, mo5, RETRACE, F, COUNT, LASTLOWBAR, BAR, X, CYCLELENGTH, DAYS, DAYS1, DAYS2, DAYS3, DAYS4, DAYS5, DIVIDEBY, DUSignal : integer;
var N, PV, DU, DU1, DU2, DU3, DU4, DU5, GAIN, GAIN1, GAIN2, GAIN3, GAIN4, GAIN5, AVERAGEGAIN, AVERAGEDU, curvol, DUBAND, DUHigh, DULow : float;
mo1:=BARCOUNT() -1 ;
mo2:=BARCOUNT() -21 ;
mo3:=BARCOUNT() -41 ;
mo4:=BARCOUNT() -61 ;
mo5:=BARCOUNT() -81 ;
RETRACE := 1;
F:=40;COUNT:=0;LASTLOWBAR :=1000000;
FOR BAR:= BARCOUNT() -1 DOWNTO BARCOUNT()-127 do
BEGIN
IF LASTLOWBAR < BAR THEN BAR:= LASTLOWBAR ;
X:= PEAKBAR(BAR, #HIGH, RETRACE) ;
N:= PEAK(BAR, #HIGH, RETRACE) - LOWEST(X-1, #LOW, 5) ;
IF N/LOWEST(X-1, #LOW, 5) >= 0.20 THEN CYCLELENGTH:= 5 ELSE
BEGIN
X:= PEAKBAR(BAR, #HIGH, RETRACE) ;
N:= PEAK(BAR, #HIGH, RETRACE) - LOWEST(X-1, #LOW, 6) ;
IF N/LOWEST(X-1, #LOW, 6) >= 0.20 THEN
CYCLELENGTH:= 6 ELSE
BEGIN
X:= PEAKBAR(BAR, #HIGH, RETRACE) ;
N:= PEAK(BAR, #HIGH, RETRACE) - LOWEST(X-1, #LOW, 7) ;
IF N/LOWEST(X-1, #LOW, 7) >= 0.20 THEN
CYCLELENGTH:= 7;
END;
END;
IF N/LOWEST(X-1, #LOW, CYCLELENGTH) >= 0.20 THEN
BEGIN
DAYS:= PEAKBAR(BAR, #HIGH, RETRACE) - LOWESTBAR(X-1, #LOW, CYCLELENGTH)+1 ;
IF PRICECLOSE(PEAKBAR(BAR, #HIGH, RETRACE) ) < PRICECLOSE(PEAKBAR(BAR, #HIGH, RETRACE)-1 ) THEN
PV:= VOLUME(PEAKBAR(BAR, #HIGH, RETRACE)-1 ) ELSE PV:= VOLUME(PEAKBAR(BAR, #HIGH, RETRACE) ) ;
F:=F+10;
LASTLOWBAR:=LOWESTBAR(X-1, #LOW, CYCLELENGTH)-1 ;
COUNT:= COUNT+1;
IF COUNT=1 THEN BEGIN
GAIN1:=N/LOWEST(X-1, #LOW, CYCLELENGTH) ;DAYS1:=DAYS;DU1:=LOWEST(mo1, #VOLUME, 20);
END;
IF COUNT=2 THEN BEGIN
GAIN2:=N/LOWEST(X-1, #LOW, CYCLELENGTH) ;DAYS2:=DAYS;DU2:=LOWEST(mo2, #VOLUME, 20);
END;
IF COUNT=3 THEN BEGIN
GAIN3:=N/LOWEST(X-1, #LOW, CYCLELENGTH) ;DAYS3:=DAYS;DU3:=LOWEST(mo3, #VOLUME, 20);
END;IF COUNT=4 THEN BEGIN
GAIN4:=N/LOWEST(X-1, #LOW, CYCLELENGTH) ;DAYS4:=DAYS;DU4:=LOWEST(mo4, #VOLUME, 20);
END;
IF COUNT=5 THEN BEGIN
GAIN5:=N/LOWEST(X-1, #LOW, CYCLELENGTH) ;DAYS5:=DAYS;DU5:=LOWEST(mo5, #VOLUME, 20);
AVERAGEGAIN:= (GAIN1+GAIN2+GAIN3+GAIN4+GAIN5)/5 ;
IF DU1>0 THEN DIVIDEBY:=1;
IF DU2>0 THEN DIVIDEBY:=2;
IF DU3>0 THEN DIVIDEBY:=3;
IF DU4>0 THEN DIVIDEBY:=4;
IF DU5>0 THEN DIVIDEBY:=5;
AVERAGEDU:= (DU1+DU2+DU3+DU4+DU5)/DIVIDEBY;
curVol := VOLUME(Barcount-1);
DUBand := AVERAGEDU*(4986/10000);
DUHigh := AverageDU + DUBand;
DULow := AverageDU - DUBand;
END;
IF COUNT = 5 THEN BREAK;
END;
END;
DUSignal:=CreateSeries();
for Bar := 1 to BarCount - 1 do
begin
IF DUHigh > curvol THEN SetSeriesValue( Bar, DUSignal, 1 );
end;
for Bar := barcount-5 to BarCount - 1 do
begin
EnableTradeNotes( false, false, false );
if not LastPositionActive then
begin
if GetSeriesValue( Bar, DUSignal ) > 0 then
BuyAtMarket( Bar+1,'In Dry Up');
SellAtMarket(Bar+1, LastPosition, 'DU Detected');
end;
end;
function calcPVADScore() : integer;
begin
var Score : integer = 0 ;
var BopTBSeries : integer = SMASeries( BOPSeries, 1 );
if (@#Close[BarCount - 1] > 1.01 * @#Close[BarCount - 2]) then
Score := Score + 4;
if (@#volume[BarCount - 1] > 1.10 * @#volume[BarCount - 2]) then
Score := Score + 2;
if @BopTBSeries[Barcount - 1] > 0.30 then
Score := Score + 1;
Result := Score;
end;
var PVADScore : integer = calcPVADScore ;
Bar := BarCount - 1;
BuyAtMarket( Bar+1,'Score: ' + FormatFloat( '0' ,PVADScore ));
Cheers!
P.S.
CNTF shows a 7 rank; REDF and SFCC has 6s' but looks like only SFCC would be a good trade based on the stoch and MACD reversing...