Closed Trade Drawdown in WL5
Author: DaveAronow
Creation Date: 8/7/2008 5:47 PM
profile picture

DaveAronow

#1
Is there any existing code for closed trade drawdown in WL5? Since each script executes separately for each symbol I don't see any easy way to do it. Any hints from the WL team?
profile picture

Eugene

#2
Hi Dave,

What is "closed trade drawdown", is it different from the Position.MAEAsOfBar property?

We have source code for closed equity performance visualizer available for download:
Community.Visualizers : Closed Equity
VS2005 source code
profile picture

DaveAronow

#3
Eugene,

The visualizer is cool although still not perfect. I could have sworn I had a visualizer I downloaded on my old PC which showed me the closed trade drawdown but I can't find it. I'm considering coding it myself but is there any code you have lying around that would do it (before I code it myself -- I'm not going to have time until after I shovel out the driveway anyway).

Dave
profile picture

Eugene

#4
Dave, although I'm still not sure what this "closed trade drawdown" concept is about. Maybe you have disabled the MAE/MFE visualizer in the Preferences dialog?
profile picture

DaveAronow

#5
Eugene,

Here's the idea behind it. Basically in the Performance tab of WL (both 4.x and 5.x) the drawdown reported is the open trade drawdown. This is simply the largest drop from an equity peak in the equity data series. However, this drawdown includes the giving back of open profits. What the closed trade drawdown would show is the worst drop in account equity of closed trades only.

The reasoning is that if you had a trade with a profit of $100,000, and it gives back half you'd see a drawdown of $50,000, but your account would never go below the initial value because you were giving back profits. Basically it's the worst drawdown of account principal (not unrealized profits).

Hope this makes sense -- it was more difficult to explain than I thought it would be.

Dave
profile picture

DaveAronow

#6
No response yet? Eugene, when did you start sleeping at night? :)
profile picture

Eugene

#7
Hi Dave,

Yes, this makes sense to me. After I finish some scheduled work, let's see if it's possible to add:

a) Closed equity drawdown -- to "Drawdown %" (as a context menu option that would switch between the traditional view and this new one)
b) Drawdown based on closed equity -- to "Performance Extras"
profile picture

DaveAronow

#8
Glad it makes sense - after writing that I found myself more confused than when I started.

Would it be possible to publish the code behind the standard performance report? That would give me or anyone else a nice boost in trying to code our own performance indicators.
profile picture

Eugene

#9
Edit (link fixed)

Fidelity holds the code behind the standard performance visualiers, so please ask them to disclose something as an example.

On the other hand, the MS123 Visualizers library is open source.
profile picture

DaveAronow

#10
QUOTE:
Fidelity holds the code behind the standard performance visualiers, so please ask them to disclose something as an example.


Yeah, but they're the same ones holding the documentation of the public interfaces hostage, so I doubt I'll get very far :(
profile picture

Eugene

#11
Hi Dave,

I guess this is how it should look like? No open trade drawdown on unrealized equity is included (the upper chart):

profile picture

jonludwig

#12
End of Day drawdown would be a nice feature as well.
profile picture

Eugene

#13
"End of Day drawdown", what is it?
profile picture

Eugene

#14
Hi Dave,

Must admit there wasn't such a thing as equity type choice on my mind when creating the visualizer. Therefore, throwing in the choice of closed vs. unrealized equity on one tab starts complicating the rest of the code. Without rewriting, it will end up as spaghetti code. So what I did was to create a copy of "Percent Drawdown" that will exclusively display the closed trade drawdown. In addition, now there are some max closed drawdown figures on the "Performance Extras" tab. Please update Community.Visualizers and let me know if there's an issue.
profile picture

DaveAronow

#15
Looks very nice, you guys are awesome. The only downside is that I need to paste the data (I ran it on 1 minute data) into a text file to get the actual drawdown numbers.

Anything you can do to get Microsoft to allow more than 64K rows in Excel? :P

Thanks again.
Dave

P.S. Still wondering what EOD drawdown is -- is that just treating positions as if they were closed at the end of the day (for intraday data)?
profile picture

Eugene

#16
Hi Dave,

QUOTE:
The only downside is that I need to paste the data (I ran it on 1 minute data) into a text file to get the actual drawdown numbers.


The mouse over tooltip and copying to clipboard didn't work?
profile picture

Dave B.

#17
Dave B. to Dave A.

More rows and columns, and other new limits
To enable you to explore massive amounts of data in worksheets, Office Excel 2007 supports up to 1 million rows and 16 thousand columns per worksheet. Specifically, the Office Excel 2007 grid is 1,048,576 rows by 16,384 columns, which provides you with 1,500% more rows and 6,300% more columns than you had available in Microsoft Office Excel 2003. For those of you who are curious, columns now end at XFD instead of IV.

Instead of 4 thousand types of formatting, you can now use an unlimited number in the same workbook, and the number of cell references per cell are increased from 8 thousand to limited by available memory.

To improve the performance of Excel, memory management has been increased from 1 GB of memory in Microsoft Office Excel 2003 to 2 GB in Office Excel 2007.

You will also experience faster calculations in large, formula-intensive worksheets because Office Excel 2007 supports multiple processors and multithreaded chipsets.

Office Excel 2007 also supports up to 16 million colors.