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

Re: [amibroker] Re: Fred's Equity Line - Problem



PureBytes Links

Trading Reference Links

Steve,

I meant: when you are copying the Equity formula via Indicator Builder 
you should make sure that it includes buy/sell/short/cover rules at the top
and then the equity plot code as shown below in case of built-in formula.

BTW: Various 3-rd party Equity plot formulas posted on this list
were not tested by me and I don't provide any guarantee on their accuracy/
performance. 
For example I noticed that Fred's formula directly references Buy/Sell
variables while this should be avoided (because causes problems when
no buy variable is specified (for example when system is for short trading only))

*IF* the line that causes an error 
FirstBar = ValueWhen(ExRem(Buy OR
is supposed to get first bar in test it should be rather
replaced by

FirstBar = Status("firstbarintest");

(I don't know what was the intention of the writer so I am just guessing)

I don't review all formulas posted on this list therefore you use them at your own risk.

=======================

Buy = Cross( Close, EMA( Close, 13 ) );
Sell = Cross( EMA( Close, 13 ), Close );
Short = Cross( EMA( Close, 13 ), Close );
Cover = Cross( Close, EMA( Close, 13 ) );

/**/
//--equity-plot-- do not remove this line
MaxGraph=0;GraphXSpace=5;
GraphZOrder=1;
Plot( Equity( 0, -2 ), "Equity", -8, styleArea );

/* now buy and hold simulation */
Short=Cover=0;
Buy=Status("firstbarintest");
Sell=Status("lastbarintest");
SetTradeDelays(0,0,0,0); PositionSize = -100;
ApplyStop(0,0,0,0);
ApplyStop(1,0,0,0);
ApplyStop(2,0,0,0);
Plot( Equity( 0, -2 ), "Buy&Hold", -9 );

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: <steve_almond@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, February 26, 2003 6:37 PM
Subject: [amibroker] Re: Fred's Equity Line - Problem


> Tomasz,
> 
> Here's a trivial backtest I've been trying. Don't know how I would 
> get the buy/sell/short/cover rules at the very top.
> 
> Should this be sufficient for the Equity New line to work?
> 
> x = ROC(MA(Foreign("^DJI","C"),50),3);
> y = ROC(MA(Foreign("^XAU","C"),50),3);
> Buy=Cross(x,y);
> Sell=Cross(y,x);
> Short=Cross(y,x);
> Cover=Cross(x,y);
> 
> Steve
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
> wrote:
> > Steve,
> > 
> > The error message is caused by undefined buy/sell/short/cover
> > rules. You have to have them at the very top of the formula.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: <steve_almond@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Wednesday, February 26, 2003 4:00 PM
> > Subject: [amibroker] Fred's Equity Line - Problem
> > 
> > 
> > > When I install Equity Line.txt from the file section, and try to 
> > > apply it, I get the following error message:
> > > 
> > > 
> > > Unknown identifier at line 30, column 33:
> > > 
> > > 
> > > FirstBar = ValueWhen(ExRem(Buy OR
> > > --------------------------------^
> > > 
> > > 
> > > Can anyone suggest a cure?
> > > 
> > > Thanks,
> > > 
> > > Steve
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > 
> > > Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> > > 
> > > 
> > >
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/