MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

ANTI Trigger Trading System by Linda Bradford Raschke
Re: A N T I Indicator

To: metastock@xxxxxxxxxxxxx
Subject: Re: A N T I Indicator
From: Philippe Poulat <poulat@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 May 1999 19:15:27 +0200
Reply-To: metastock@xxxxxxxxxxxxx
Sender: owner-metastock@xxxxxxxxxxxxx


At 04:36 09/05/99 -0500, you wrote:

All, Last week as I was perusing the misc.invest.futures newsgroup I came across a post containing what I guess is the TradeStation code for LindaBradford Raschkes "ANTI" indicator from the book "Street Smarts". I've copiedthatpost in it's entirety should someone here want to have a go at translatingit into MetaStock code. All I ask is anyone who is successful please sharewith the group. Regards, Bill N. Milwaukee, WI USA

On Sat, 8 May 1999 10:21:30 +0800, "Ezzz" <cael@xxxxxxxxxxxx> wrote:

Does anyone trade the ANTI described in the book Street Smarts?
I believe credit for this goes to "The Code".
===================================================================

{ANTI TRIGGER}


INPUT:FASTLINE(SLOWK(7)),SLOWLINE(SLOWD(10)),
SETBARS(3),ENTRYADD(1 POINTS),EXITADD(1 POINTS);


VAR:BBUY(0),SSELL(0),CBUY(0),CSELL(0),FF(0),SS(0),
LXSTOP(0),SXSTOP(99999),MP(0);

FF=FASTLINE;
SS=SLOWLINE;
MP=MARKETPOSITION;
IF MP<1 THEN LXSTOP=L-EXITADD;
IF MP>-1 THEN SXSTOP=H+EXITADD;
IF BBUY[1]<99999 AND H>=BBUY[1] THEN LXSTOP=L-EXITADD;
IF SSELL[1]>0 AND L<=SSELL[1] THEN SXSTOP=H+EXITADD;
EXITLONG("InitialStop") LXSTOP STOP;
EXITSHORT("InitialStop ") SXSTOP STOP;

IF FF>=FF[1] AND SS<=SS[1] THEN CSELL=CSELL+1 ELSE CSELL=0;
IF FF<=FF[1] AND SS>=SS[1] THEN CBUY=CBUY+1 ELSE CBUY=0;

IF CBUY>=SETBARS THEN BBUY=H+ENTRYADD ELSE BBUY=99999;
IF CSELL>=SETBARS THEN SSELL=L-ENTRYADD ELSE SSELL=0;

IF BBUY<99999 THEN BUY("AntiTrigger") BBUY STOP;
IF SSELL>0 THEN SELL("AntiTrigger ") SSELL STOP;

ANTI Trigger Trading System

Enter long :

setbars:=opt1{3};
entryadd:=opt2{1};
ff:=mov(stoch(7,1),3,e);
ss:=mov(Mov(Stoch(10,1),3,E),3,e);
cbuy:=if(ff<=ref(ff,-1) and ss>=ref(ss,-1),cum(1),0);
bbuy:=if(cbuy>=setbars,H+entryadd, 99999);
bbuy<99999


Exit long :

setbars:=opt1{3};
entryadd:=opt2{1};
exitadd:=opt3{1};
ff:=mov(stoch(7,1),3,e);
ss:=mov(Mov(Stoch(10,1),3,E),3,e);
cbuy:=if(ff<=ref(ff,-1) and ss>=ref(ss,-1),cum(1),0);
bbuy:=if(cbuy>=setbars,H+entryadd, 99999);
lxstop:=if(ref(bbuy,-1)<99999 and h>=ref(bbuy,-1),l-exitadd,l);
c<=lxstop

Enter short :

setbars:=opt1{3};
entryadd:=opt2{1};
ff:=mov(stoch(7,1),3,e);
ss:=mov(Mov(Stoch(10,1),3,E),3,e);
csell:=if(ff>=ref(ff,-1) and ss<=ref(ss,-1),cum(1),0);
ssell:=if(csell>=setbars,l-entryadd,0);
ssell>0

Exit short :

setbars:=opt1{3};
exitadd:=opt3{1};
entryadd:=opt2{1};
ff:=mov(stoch(7,1),3,e);
ss:=mov(Mov(Stoch(10,1),3,E),3,e);
csell:=if(ff>=ref(ff,-1) and ss<=ref(ss,-1),cum(1),0);
ssell:=if(csell>=setbars,l-entryadd,0);
sxstop:=if(ref(ssell,-1)>0 and l<=ref(ssell,-1),h+exitadd,h);
c>=sxstop

 

 

For this one some approximations were done because of differences in calculation in slowk/slowD compared to stoch in metastock and also because of impossibility (as far as I know for EOD version) to to set stop or limit order in metastock. In addition you could do some optimization on ff or ss.

>>>>
(ANTI TRIGGER 1}

INPUT:FASTLINE(AVERAGE(C,3)-AVERAGE(C,10)),SLOWLINE(AVERAGE(AVERAGE(C,3) - AVERAGE(C,10),16)),
SETBARS(3),ENTRYADD(1 POINTS),EXITADD(1 POINTS);

VAR:BBUY(0),SSELL(0),CBUY(0),CSELL(0),FF(0),SS(0),
LXSTOP(0),SXSTOP(99999),MP(0);

FF=FASTLINE;
SS=SLOWLINE;
MP=MARKETPOSITION;
IF MP<1 THEN LXSTOP=L-EXITADD;
IF MP>-1 THEN SXSTOP=H+EXITADD;
IF BBUY[1]<99999 AND H>=BBUY[1] THEN LXSTOP=L-EXITADD;
IF SSELL[1]>0 AND L<=SSELL[1] THEN SXSTOP=H+EXITADD;
EXITLONG("InitialStop") LXSTOP STOP;
EXITSHORT("InitialStop ") SXSTOP STOP;

IF FF>=FF[1] AND SS<=SS[1] THEN CSELL=CSELL+1 ELSE CSELL=0;
IF FF<=FF[1] AND SS>=SS[1] THEN CBUY=CBUY+1 ELSE CBUY=0;

IF CBUY>=SETBARS THEN BBUY=H+ENTRYADD ELSE BBUY=99999;
IF CSELL>=SETBARS THEN SSELL=L-ENTRYADD ELSE SSELL=0;

IF BBUY<99999 THEN BUY("AntiTrigger") BBUY STOP;
IF SSELL>0 THEN SELL("AntiTrigger ") SSELL STOP;

<<<<
just replace in all conditions

ff:=mov(c,3,s)-mov(c,10,s);
ss:=mov(ff,16,s);

>>>>
{ANTI BASIC 2}


Input: FASTLINE(SLOWK(7)),SLOWLINE(SLOWD(10));
IF FASTLINE CROSSES OVER FASTLINE[1] AND SLOWLINE>SLOWLINE[1] AND
SLOWLINE[1]>SLOWLINE[2] Then Buy on Close;
IF FASTLINE CROSSES UNDER FASTLINE[1] AND SLOWLINE<SLOWLINE[1] AND
SLOWLINE[1]<SLOWLINE[2] Then Sell on Close;

{ANTI BASIC 1}

Input:
FASTLINE(AVERAGE(C,3)-AVERAGE(C,10)),SLOWLINE(AVERAGE(AVERAGE(C,3) - AVERAGE(C,10),16));
IF FASTLINE CROSSES OVER FASTLINE[1] AND SLOWLINE>SLOWLINE[1] AND
SLOWLINE[1]>SLOWLINE[2] Then Buy on Close;
IF FASTLINE CROSSES UNDER FASTLINE[1] AND SLOWLINE<SLOWLINE[1] AND
SLOWLINE[1]<SLOWLINE[2] Then Sell on Close;


<<<<
This one is non understandable : "IF FASTLINE CROSSES OVER FASTLINE[1] "?????
>>>>

Sincerely,
Philippe Poulat

[13838]

 
Source / From: TOP
http://purebytes.com/archives/metastock/

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!