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

RE: [amibroker] question about writeif



PureBytes Links

Trading Reference Links

Hello,

Please approve my membership to... 
http://www.egroups.com/messages/amibroker-beta/
...so that I may "Just read the archives".

A thousand thanks,
Bill


--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Dale,
> 
> Jeez.... there is absolutely nothing you should worry about. 
> 
> It was explained long time ago in the amibroker-beta group 
> http://www.egroups.com/messages/amibroker-beta/
> as well as in the user's guide.
> Portfolio Equity is available in "C" field of ~~~EQUITY (special 
ticker).
> 
> Individual-Backtest Equity WAS available via Equity() function in 
all versions since the very beginning.
> And this remains so in version 4.50 and UP. 
http://www.amibroker.com/f?equity
> 
> NOTHING has changed in how Equity() funciton works.
> 
> If you have used it in the past (with 4.40 and earlier versions) 
you can continue using the VERY SAME formulas without any 
modification.
> 
> Equity() always refered and refers now to individual backtest 
equity.
> 
> "NEW" individual backtest and "OLD" backtesters produce THE SAME 
results, provided that you don't use
> "pad and align" feature. 
> 
> Thus Equity() gives the same result as "OLD" backtester and the 
same as "NEW" backtester in "INDIVIDUAL BACKTEST" mode.
> 
> PORTFOLIO backtest is different. I will NOT explain it more. This 
topic was already discussed to death on 
> amibroker-beta list. Just read the archives:
> http://www.egroups.com/messages/amibroker-beta/
> 
> As for removing extra signals/evaluating stops using Equity(1) - 
you can continue to do so regardless of backtester you are using.
> This worked in the past and works now without need to change any 
single line of code.
> It works also perfectly in new portfolio backtest mode.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
>   ----- Original Message ----- 
>   From: dingo 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Saturday, May 15, 2004 6:42 PM
>   Subject: RE: [amibroker] Re: Help: different results Explore vs 
Individual Backtest
> 
> 
>   Whoa duude!
> 
>   You just got my head spinning with "Equity() funciton is an OLD 
backtester (that performs equity calculation on SINGLE SECURITY 
backtest, not on portfolio).
>   http://www.amibroker.com/f?equity";
> 
>   Are we now NOT to use the Equity function at all when running 
portfolio backtests and individual backtests? Or is it just Equity() 
and not Equity(1)?  I've been running both portfolio and individual 
while using Equity(1) to make the applystops work and to remove 
excess signals (instead of Exrem).  If I'm not to use the Equity(1) 
then what should I be using?
> 
>   d
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
>     From: Tomasz Janeczko [mailto:amibroker@x...] 
>     Sent: Saturday, May 15, 2004 12:28 PM
>     To: amibroker@xxxxxxxxxxxxxxx
>     Subject: Re: [amibroker] Re: Help: different results Explore vs 
Individual Backtest
> 
> 
>     Hello,
> 
>     Portfolio backtesting is performed on PORTFOLIO level (some 
trades may be dropped due
>     to insufficient funds)
>     INDIVIDUAL backtest in performed on SYMBOL-BY-SYMBOL basis (not 
portfolio) - all trades 
>     are taken - hence the difference.
> 
>     It is all explained in the users guide. 
>     http://www.amibroker.com/guide/h_portfolio.html
> 
> 
>     Equity() funciton is an OLD backtester (that performs equity 
calculation on
>     SINGLE SECURITY backtest, not on portfolio).
>     http://www.amibroker.com/f?equity
> 
>     PORTFOLIO equity is ****NOT**** the sum of individual backtest 
equities !!!
>     ==================================================
> 
>     If it was that easy there would be NO REASON to implement 
portfolio backtesting at all.
> 
>     Best regards,
>     Tomasz Janeczko
>     amibroker.com
>     ----- Original Message ----- 
>     From: "eseward_2000" <eseward_2000@xxxx>
>     To: <amibroker@xxxxxxxxxxxxxxx>
>     Sent: Friday, May 14, 2004 7:01 PM
>     Subject: [amibroker] Re: Help: different results Explore vs 
Individual Backtest
> 
> 
>     > Hi Patrick,
>     > 
>     > I too am having an issue like this with the portfolio 
backtester vs 
>     > an individual explore: different results. I also have 
SetTradeDelays 
>     > @ zero and sell @ close.
>     > 
>     > Am eager to see any explanation or help on this.
>     > 
>     > FYI: Also in portfolio backtesting, seeing a buy trade delay 
of 1 on 
>     > weekly periodicity giving me the PositionScore for the 
PREVIOUS week 
>     > (instead of giving PositionScore for the CURRENT week and 
using the 
>     > value of the following bar for buying).
>     > 
>     > Bill
>     > 
>     > 
>     > --- In amibroker@xxxxxxxxxxxxxxx, "vlanschot" <ecbu@xxxx> 
wrote:
>     > > Jayson,
>     > > 
>     > > Thanks for the reply.
>     > > 
>     > > My AA-settings are exactly the same as the ones specified 
in the 
>     > > code: BuyP = SellP = ShortP = CoverP =C, with a delay =1. 
In any 
>     > > case, I always assumed that the SetTradeDelays (which I 
specified) 
>     > > overruled the ones in AA-Settings.
>     > > 
>     > > In addition, as you can see in the code, I use no stops, 
etc. Also, 
>     > > the dates and type of trades agree, it's just the equity-
amounts 
>     > that 
>     > > disagree.
>     > > 
>     > > I assume that you always have been able to replicate the 
results in 
>     > > Individual Backtest exactly in Explore, so my search 
continues.
>     > > 
>     > > Thanks again,
>     > > 
>     > > Patrick
>     > > 
>     > > --- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> 
wrote:
>     > > > Patrick,
>     > > > check the settings in AA. perhaps you are using a 
buy/sell delay 
>     > or
>     > > > entering/ exiting on high or low instead of the close you 
use in 
>     > > your
>     > > > exploration...... You might have a look at the back 
testing 
>     > > tutorial in the
>     > > > help files
>     > > > 
>     > > > Regards,
>     > > > 
>     > > > Jayson
>     > > > 
>     > > >   -----Original Message-----
>     > > >   From: vlanschot [mailto:ecbu@x...]
>     > > >   Sent: Friday, May 14, 2004 4:37 AM
>     > > >   To: amibroker@xxxxxxxxxxxxxxx
>     > > >   Subject: [amibroker] Help: different results Explore vs 
>     > Individual
>     > > > Backtest
>     > > > 
>     > > > 
>     > > >   Hello AB Community,
>     > > > 
>     > > >   Perhaps somebody can help me with the following.
>     > > > 
>     > > >   Below I have a simple example strategy which I run in 
both 
>     > Explore
>     > > >   and Individual Backtest. You can use any group of 
securities 
>     > > yourself
>     > > >   to replicate.
>     > > > 
>     > > >   The problem is that I get different results in the 
Equity(1) 
>     > > (here:
>     > > >   IndivEq) via Explore versus the results shown in the 
Individual
>     > > >   Backtest. Differences amount to a couple of dollars to 
a few
>     > > >   thousand. So the question is: how can I make sure that 
I get 
>     > the 
>     > > same
>     > > >   (equity) results in Explore and in the Individual 
Backtest.
>     > > > 
>     > > >   No doubt there is a simple explanation here, but I 
can't figure 
>     > it
>     > > >   out.
>     > > > 
>     > > >   Thanks in advance for your help.
>     > > > 
>     > > >   Patrick
>     > > > 
>     > > >   Filter=1;
>     > > > 
>     > > >   Groep=GroupID();
>     > > >   List = GetCategorySymbols(categoryGroup,Groep);
>     > > >   //SetBarsRequired(10,10);
>     > > > 
>     > > >   MPLB=126; //Daily
>     > > >   AnnPer = 256;
>     > > > 
>     > > >   for( n=1; (Ticker=StrExtract( List, n))!= ""; n++)
>     > > >   {
>     > > >   k=n+1;
>     > > >   }
>     > > > 
>     > > >   //TypeBacktest=Status("action");
>     > > >   Scan = Status("Action")==3;
>     > > >   Indicator = Status("Action")==1;
>     > > >   Explore = Status("Action")==4;
>     > > >   Backtest = Status("Action")==5;
>     > > > 
>     > > >   SetOption("InterestRate",0);
>     > > >   SetOption("MaxOpenPositions",k);
>     > > >   SetOption ("CommissionMode",1);
>     > > >   CommPerc = Param("Commission%",1,0.25,5);
>     > > >   SetOption("CommissionAmount", CommPerc);
>     > > > 
>     > > >   WLScan = 0;
>     > > >   if (Scan AND WLScan==1)// = Scan Mode for Next day's 
trades
>     > > >   Delay = 0;
>     > > >   else
>     > > >   Delay = 1;
>     > > > 
>     > > >   SetTradeDelays( Delay, Delay, Delay, Delay );
>     > > > 
>     > > >   StartCapital = 1000000;
>     > > > 
>     > > >   PFBT = 0;
>     > > > 
>     > > >   if (Scan OR Explore OR (Backtest AND PFBT==0))
>     > > >   SetOption("InitialEquity",StartCapital/k);
>     > > >   else
>     > > >   if (Backtest AND PFBT==1) SetOption
>     > ("InitialEquity",StartCapital);
>     > > > 
>     > > >   BarInTest=Status("barinrange");
>     > > >   ValidB=//1;
>     > > >   BarIntest==1;
>     > > > 
>     > > >   Buy=ValidB AND MACD()>Signal() ;
>     > > >   Sell = ValidB AND Signal()>MACD();
>     > > >   //Short = Sell; Cover = Buy;
>     > > >   Short=0; Cover = 0;
>     > > > 
>     > > >   BuyPrice=SellPrice=ShortPrice=CoverPrice=Close;
>     > > > 
>     > > >   SigEq=1;
>     > > > 
>     > > >   IndivEq = Equity(SigEq);
>     > > >   AddToComposite( Indiveq, "~ComposEq", "C" );
>     > > >   ComposEq = Foreign("~ComposEq","C");
>     > > > 
>     > > >   PFBTCap = LastValue(ValueWhen(Status
>     > > ("firstbarinrange"),ComposEq));
>     > > > 
>     > > >   if(Backtest AND PFBT==1)
>     > > > 
>     > > >   PositionSize=
>     > > >   //IndivEq;
>     > > >   -IndivEq/ComposEq;
>     > > >   //-100/k;
>     > > >   else
>     > > >   PositionSize=-100;
>     > > > 
>     > > >   PositionScore =
>     > > >   //1;
>     > > >   100 - RSI(14);
>     > > > 
>     > > >   AddColumn(Indiveq,"IndivEq", 1.3);
>     > > >   AddColumn(ComposEq,"CompEq", 1.3);
>     > > > 
>     > > > 
>     > > > 
>     > > > 
>     > > >   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
>     > > > 
>     > > > 
>     > > >         Yahoo! Groups Sponsor
>     > > >               ADVERTISEMENT
>     > > > 
>     > > > 
>     > > > 
>     > > > 
>     > > > 
>     > > > ----------------------------------------------------------
--------
>     > --
>     > > --------
>     > > > --
>     > > >   Yahoo! Groups Links
>     > > > 
>     > > >     a.. To visit your group on the web, go to:
>     > > >     http://groups.yahoo.com/group/amibroker/
>     > > > 
>     > > >     b.. To unsubscribe from this group, send an email to:
>     > > >     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>     > > > 
>     > > >     c.. Your use of Yahoo! Groups is subject to the 
Yahoo! Terms 
>     > of 
>     > > Service.
>     > 
>     > 
>     > 
>     > 
>     > 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 
>     > Yahoo! Groups Links
>     > 
>     > 
>     > 
>     >  
>     > 
>     > 
> 
> 
>     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 
> 
> 
> 
> 
>     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 
> 
> 
>           Yahoo! Groups Sponsor 
>                 ADVERTISEMENT
>                
>          
>          
> 
> 
> --------------------------------------------------------------------
--------
>     Yahoo! Groups Links
> 
>       a.. To visit your group on the web, go to:
>       http://groups.yahoo.com/group/amibroker/
>         
>       b.. To unsubscribe from this group, send an email to:
>       amibroker-unsubscribe@xxxxxxxxxxxxxxx
>         
>       c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of Service.



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

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