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

Re: Code for 'Holy Grail'?



PureBytes Links

Trading Reference Links

{Holy Grail - from the book by Rashcke and Conners}

INPUT:ADXLEN(14),CUTOFF(30),XMALEN(20),
  ENTRYADD(1 POINTS),EXITADD(1 POINTS);

VAR:ADX14(0),XMA20(0),BBUY(99999),SSELL(0),REBUY(99999),RESELL(0),
  SETBUY(FALSE),SETSELL(FALSE),GOREBUY(FALSE),GORESELL(FALSE),
  LXSTOP(0),SXSTOP(99999),MP(0);

MP=MARKETPOSITION;
ADX14=ADX(ADXLEN);
XMA20=XAVERAGE(C,XMALEN);

IF MP<1 THEN LXSTOP=MINLIST(L,L[1],L[2])-EXITADD;
IF MP>-1 THEN SXSTOP=MAXLIST(H,H[1],H[2])+EXITADD;
IF BBUY[1]<99999 AND H>=BBUY[1] THEN BEGIN
  LXSTOP=MINLIST(L-EXITADD,LXSTOP);
  GOREBUY=TRUE;
END;
IF SSELL[1]>0 AND L<=SSELL[1] THEN BEGIN
  SXSTOP=MAXLIST(H+EXITADD,SXSTOP);
  GORESELL=TRUE;
END;
EXITLONG("InitialStop") LXSTOP STOP;
EXITSHORT("InitialStop ") SXSTOP STOP;

IF ADX14>CUTOFF AND ADX14>ADX14[1] THEN BEGIN
  IF L>XMA20 THEN SETBUY=TRUE;
  IF H<XMA20 THEN SETSELL=TRUE;
END;
IF L>XMA20 THEN BEGIN
  SETSELL=FALSE;
  RESELL=0;
END;
IF H<XMA20 THEN BEGIN
  SETBUY=FALSE;
  REBUY=99999;
END;
IF MP=1 THEN SETBUY=FALSE;
IF MP=-1 THEN SETSELL=FALSE;
IF SETSELL=FALSE THEN SSELL=0;
IF SETBUY=FALSE THEN BBUY=99999;

IF MP[1]=0 THEN BEGIN
  IF L<=RESELL[1] AND GORESELL[1] THEN RESELL=0;
  IF H>=REBUY[1] AND GOREBUY[1] THEN REBUY=99999;
END;
IF MP=0 THEN BEGIN
  IF POSITIONPROFIT(1)>0 OR (H>H[2] AND H>H[1] AND L>XMA20) THEN BEGIN
    RESELL=0;
    GORESELL=FALSE;
  END;
  IF RESELL>0 THEN SELL("HG Re-Sell") RESELL STOP;
  IF POSITIONPROFIT(1)>0 OR (L<L[2] AND L<L[1] AND H<XMA20) THEN BEGIN
    REBUY=99999;
    GOREBUY=FALSE;
  END;
  IF REBUY<99999 THEN BUY("HG Re-Buy") REBUY STOP;
END;

IF SETBUY AND L<=XMA20 THEN BBUY=H+ENTRYADD;
IF SETSELL AND H>=XMA20 THEN SSELL=L-ENTRYADD;

IF BBUY<99999 THEN BEGIN
  BUY("HolyGrail") BBUY STOP;
  REBUY=BBUY;
END;
IF SSELL>0 THEN BEGIN
  SELL("HolyGrail ") SSELL STOP;
  RESELL=SSELL;
END;


----- Original Message ----- 
From: <Kenlow7@xxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Tuesday, November 14, 2000 10:04 PM
Subject: Code for 'Holy Grail'?


> Anyone have TS2000i Easylanguage code for 'Holy Grail'
> technique by Connors/Raschke?   Thanks,
> 
> Ken
>