CurEq = Foreign("~~~Equity", "C", 1);
MaxEq = Highest(CurEq);
CurDD = IIf(CurEq < MaxEq, 100 * (MaxEq - CurEq) / MaxEq, 0);
MaxDD = Highest(CurDD);
MDDBar = MaxDD == LastValue(MaxDD) AND CurDD == MaxDD AND CurDD !=
Ref(CurDD, -1);
CDD0Bar = Cum(0);
CDD0 = LastValue(Highest(IIf(MDDBar == 1, BarIndex() - BarsSince(CurDD ==
0), 0)));
CDD0Bar[CDD0] = 1;
MDDDate = LastValue(Highest(ValueWhen(MDDBar, DateTime())));
CDD0Date = LastValue(Highest(ValueWhen(CDD0Bar, DateTime())));
Title = "MDD Beg - " + NumToStr(CDD0Date, formatDateTime) + " " +
"MDD End - " + NumToStr(MDDDate, formatDateTime) + " " +
"MDD% - " + NumToStr(LastValue(MaxDD), 1.2);
Plot(MaxDD, "MaxDD", colorRed);
Plot(CurDD, "CurDD", colorYellow);
Plot(MDDBar, "MDDBar", colorWhite, styleHistogram | styleOwnScale |
styleThick);
Plot(CDD0Bar, "CDD0Bar", colorBlue, styleHistogram | styleOwnScale |
styleThick);
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of tipequity
Sent: Friday, August 15, 2008 1:36 AM
To: [email protected]
Subject: Re: [amibroker] Another Code Puzzle
(LOL), would you please show me how? Thanks
--- In [EMAIL PROTECTED] <mailto:amibroker%40yahoogroups.com> ps.com, Fred
Tonetti <[EMAIL PROTECTED]> wrote:
>
> Yes there is .
>
>
>
> _____
>
> From: [EMAIL PROTECTED] <mailto:amibroker%40yahoogroups.com> ps.com
[mailto:[EMAIL PROTECTED] <mailto:amibroker%40yahoogroups.com> ps.com]
On Behalf
> Of tipequity
> Sent: Friday, August 15, 2008 1:15 AM
> To: [EMAIL PROTECTED] <mailto:amibroker%40yahoogroups.com> ps.com
> Subject: Re: RE: [amibroker] Another Code Puzzle
>
>
>
> Fred
>
> Is there a way to include the starting and ending dates for max
> drawdown in the title? TIA
>
>
>
>
> _____
>
> I am using the free version of SPAMfighter for private users.
> It has removed 526 spam emails to date.
> Paying users do not have this message in their emails.
> Try SPAMfighter <http://www.spamfigh <http://www.spamfighter.com/len>
ter.com/len> for free now!
>
_____
I am using the free version of SPAMfighter for private users.
It has removed 526 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter <http://www.spamfighter.com/len> for free now!