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

[amibroker] Re: Calculation of Equity and Drawdowns - trying to understand what's going on..



PureBytes Links

Trading Reference Links

Ken,

No.  Max DD is not related to any single trade, in fact Max DD can 
occur in a totally different time period then when max trade loss 
occurs and is the maximum adverse excursion in terms of percent from 
any previous peak in the equity curve or in other words:

If you have:

CurEq    = Equity();

then ...
 
MaxEq    = Highest(CurEq);
CurDD    = (MaxEq - CurEq) / MaxEq;
MaxDD    = Highest(CurDD);

Fred

P.S. Max Trade Loss also has nothing to do with Max Trade DD which of 
course can occur in a totally different time period then either Max 
Trade Loss or Max DD.

--- In amibroker@xxxxxxxxxxxxxxx, "Ken Close" <closeks@xxxx> wrote:
> Fred:
> 
> Do you agree that over all trades, if the 20% equity dd of that one
> trade that I described is the largest dd of all, then it is called 
the
> MaxDD?
> 
> Max Trade loss is determined by sorting the Profit% column in the
> backtest grid and looking at the min value (the highest minus 
value).
> This one trade will be the largest Trade Loss (what I was calling 
Loss
> in Trade).  It is NOT the Mdd.
> 
> Do you agree?
> 
> Ken
> 
> -----Original Message-----
> From: Fred [mailto:fctonetti@x...] 
> Sent: Friday, May 16, 2003 9:47 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Calculation of Equity and Drawdowns - 
trying to
> understand what's going on..
> 
> NO ...
> 
> Max TRADE loss applies to a single trade as is also referred to as 
> largest loss ... and is in the case you describe 20% ...
> 
> Max DD is NOT constricted to the confines of ONE trade ... think of 
> it as having two back to back trades like the one you descibe ... 
> largest loss is still 20% but Max DD is 40%
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Ken Close" <closeks@xxxx> wrote:
> > I would like to clarify the difference between Maxdd and 
Max "Loss 
> in
> > Trade"
> > 
> >  
> > 
> > As an example, suppose I buy a stock at 90 and it rises to 100, 
then
> > falls to 80, then rises to 85, and I sell it at 85. (Or the 
system 
> makes
> > these events happen.)
> > 
> >  
> > 
> > I think the MaxDD is 20% (100-80/100) or 20/100, but the Max Loss 
in
> > Trade is 5.55%  (90-85/90) or 5/90.  This latter phrase assumes 
> that the
> > 5.55% is the maximum loss of all trades during the backtest 
period.
> > 
> >  
> > 
> > Is this correct?
> > 
> >  
> > 
> > Ken
> > 
> >  
> > 
> > -----Original Message-----
> > From: Tomasz Janeczko [mailto:amibroker@x...] 
> > Sent: Friday, May 16, 2003 5:33 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: Re: [amibroker] Calculation of Equity and Drawdowns - 
> trying to
> > understand what's going on..
> > 
> >  
> > 
> > Hello,
> > 
> >  
> > 
> > The rule with no commission, no interest:
> > 
> >  
> > 
> > Profit = ( SellPrice - BuyPrice ) * NumOfShares;
> > 
> >  
> > 
> > (where sellprice is either sellprice or shortprice, and buyprice 
is
> > either buyprice or coverprice)
> > 
> >  
> > 
> > Your 
> > 
> > SellPrice = 44.46  (one bar delay from short signal)
> > 
> > BuyPrice = 45.84 (the bar at which equity is calculated)
> > 
> >  
> > 
> > Profit ( 44.46 - 45.84 ) * 224.921 = -310.3910
> > 
> >  
> > 
> > Now your equity at entry = 10000
> > 
> > so equity at "yellow" line = 10000 + Profit = 10000 - 310.3910 = 
> 9689.61
> > 
> >  
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > 
> > ----- Original Message ----- 
> > 
> > From: dingo <mailto:dingo@x...>  
> > 
> > To: _amibroker_yahoo <mailto:amibroker@xxxxxxxxxxxxxxx>  ;
> > tj@xxxx 
> > 
> > Sent: Friday, May 16, 2003 9:49 PM
> > 
> > Subject: [amibroker] Calculation of Equity and Drawdowns - trying 
to
> > understand what's going on..
> > 
> >  
> > 
> > Please help me understand how Amibroker calculates equity and
> > drawdowns!!
> > 
> > ------------------------------------------------------------------
--
> ----
> > -----------
> > 
> > Here are my settings:
> > 
> > Settings:   Delay = 1, Open for all signals
> >                  No interest, no commissions,  drawdown figures 
> based
> > on: worst case
> > 
> > ------------------------------------------------------------------
--
> ----
> > -----------
> > And here is the Afl Used to produce the csv data which is below 
the
> > formula:
> > 
> > {buy/sell etc. goes here}
> > 
> > 
> > E = Equity();
> > 
> > Filter=1;
> > 
> > BIR      = IIf(Status("BarInRange") > 0, 1, 0);
> > 
> > CurEq    = Equity();
> > MaxEq    = Highest(CurEq);
> > 
> > CurDD    = IIf(BIR, 100 * (MaxEq - CurEq) / MaxEq, 0);
> > MaxDD    = Highest(CurDD);
> > 
> > AddColumn(Buy,"Buy",1.0);
> > AddColumn(Sell,"Sell",1.0);
> > AddColumn(Short,"Short",1.0);
> > AddColumn(Cover,"Cover",1.0);
> > AddColumn(O, "Open",1.2);
> > AddColumn(L, "Low",1.2);
> > AddColumn(H, "High",1.2);
> > AddColumn(C, "Close",1.2);
> > 
> > AddColumn(MaxEq,"MaxEq",1.2);
> > AddColumn(CurEq,"Equity()",1.2);
> > AddColumn(-CurDD,"CDD%",1.2);
> > AddColumn(-MaxDD,"MDD%",1.2);
> > 
> >  
> > 
> > 
> > Ticker
> > 
> > Date/Time
> > 
> > Buy
> > 
> > Sell
> > 
> > Short
> > 
> > Cover
> > 
> > Open
> > 
> > Low
> > 
> > High
> > 
> > Close
> > 
> > MaxEq
> > 
> > Equity()
> > 
> > CDD%
> > 
> > MDD%
> > 
> > 
> > AD
> > 
> > 05/01/2002
> > 
> > 0
> > 
> > 0
> > 
> > 1
> > 
> > 0
> > 
> > 43.40
> > 
> > 43.00
> > 
> > 44.61
> > 
> > 44.51
> > 
> > 10,000.00
> > 
> > 10,000.00
> > 
> > 0.00
> > 
> > 0.00
> > 
> > 
> > AD
> > 
> > 05/02/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 44.46
> > 
> > 44.19
> > 
> > 45.19
> > 
> > 44.48
> > 
> > 10,000.00
> > 
> > 10,000.00
> > 
> > 0.00
> > 
> > 0.00
> > 
> > 
> > AD
> > 
> > 05/03/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 44.73
> > 
> > 44.67
> > 
> > 45.19
> > 
> > 45.07
> > 
> > 10,000.00
> > 
> > 9,939.27
> > 
> > -0.61
> > 
> > -0.61
> > 
> > 
> > AD
> > 
> > 05/06/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 45.10
> > 
> > 44.71
> > 
> > 45.50
> > 
> > 44.71
> > 
> > 10,000.00
> > 
> > 9,856.05
> > 
> > -1.44
> > 
> > -1.44
> > 
> > 
> > AD
> > 
> > 05/07/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 44.70
> > 
> > 44.60
> > 
> > 45.36
> > 
> > 45.17
> > 
> > 10,000.00
> > 
> > 9,946.02
> > 
> > -0.54
> > 
> > -1.44
> > 
> > 
> > AD
> > 
> > 05/08/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 45.32
> > 
> > 45.00
> > 
> > 45.79
> > 
> > 45.79
> > 
> > 10,000.00
> > 
> > 9,806.57
> > 
> > -1.93
> > 
> > -1.93
> > 
> > 
> > AD
> > 
> > 05/09/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 45.84
> > 
> > 44.80
> > 
> > 45.84
> > 
> > 44.80
> > 
> > 10,000.00
> > 
> > 9,689.61
> > 
> > -3.10
> > 
> > -3.10
> > 
> > 
> > AD
> > 
> > 05/10/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 1
> > 
> > 44.84
> > 
> > 43.76
> > 
> > 44.84
> > 
> > 43.88
> > 
> > 10,000.00
> > 
> > 9,914.53
> > 
> > -0.85
> > 
> > -3.10
> > 
> > 
> > AD
> > 
> > 05/13/2002
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 0
> > 
> > 43.88
> > 
> > 43.51
> > 
> > 44.09
> > 
> > 43.90
> > 
> > 10,130.46
> > 
> > 10,130.46
> > 
> > 0.00
> > 
> > -3.10
> > 
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > 
> >  
> > 
> > 224.921 shares
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > The trade in the above is a Short and the results are from an
> > Exploration.
> > 
> >  
> > 
> > The line I'm interested in is the yellow one.  How did the equity
() 
> calc
> > come up with 9,689.61?  
> > 
> >  
> > 
> > Thanks for any/all explanations!!
> > 
> >  
> > 
> > d
> > 
> > 
> > 
> > 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 the Yahoo!
> > <http://docs.yahoo.com/info/terms/>  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 
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/>  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 
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/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 

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