I'm confused by the different results I see between DD% and DD% (closed). The concept makes sense but it doesn't jive with what I'm seeing.
I'm testing a system that runs on 15min bars and closes all positions at the end of each day. So the difference between the open and closed equity is very small and should match at the end of each day. But I consistently see DD% and DD% (closed) values that differ by as much as 2:1. E.g. my current test has DD% of 31.93% and DD% (closed) of 16.63%. Looking at the Equity+Drawdown% curve, it's clear the worst drawdown is just over 30%. I can zoom in on the equity curve and see the day-by-day results, which clearly show the open equity and closed equity match within a few percent during the worst drawdown.
Where is DD% (closed) getting its 17% figure!? I wish it was accurate but it doesn't seem to reflect reality!
Gary
Size:
Color:
You didn't mean to tell "Community Scorecard", didn't you? That's for optimizing and ranking.
Then, where does the figure comes from -- the "Performance+" tab? or the "Closed equity" chart (which visually looks misaligned - a fix is coming tomorrow)?
Size:
Color:
No, I meant "Community Scorecard," used in optimizing and ranking.
In my optimization run, DD% (closed) runs about half of DD%. Why?
Size:
Color:
No idea where this thing is coming from. Just made a test on 3 years of 15-min AAPL bars, using the canned Moving Average Crossover goodness.
My drawdown on unrealized equity is nearly identical compared to the max DD on closed equity, e.g. -24.69% vs. -24.61%.
For sure, we'd need more details to be able to reproduce the issue.
Size:
Color:
Hm. It seems to depend on the size of the basket you're trading.
I just ran the MA Crossover script on a single stock (AA, **daily** bars) with Slow = 50 and Fast = 5 to 45 by 5, starting 4/1/09. DD% and DD% (closed) were significantly different but it was like 1.5% vs. 0.5%.
Now try running it on the Dow 30 starting 4/1/09, still daily bars. I get Drawdown% in the -4 to -5% range -- but Drawdown% (closed) ranges from -0.46% to -1.22%.
Oddly enough, I tried repeating the same test on some 15min stock data, and I saw no difference even with 10 stocks in the basket.
If you can't replicate it with this, I'll open up a ticket and send you my system.
Size:
Color:
Drawdown on closed equity is always lower than on open equity, so -4% vs. -1% is expected. You could use the
Closed Equity Drawdown visualizer to track and run the usual DD chart side by side to compare.
Size:
Color:
I must be misunderstanding something... the Closed Equity in WL makes no sense to me.
If I enter a trade, the open profit adds to my equity but not my closed-trade equity. If I then close it, the profit from the trade is added to my closed equity. While no trades are open, the open and closed equity are identical, yes?
And if my system opens trades every day, and CLOSES all trades every day, the open and closed equities should be identical at the close of every day, correct?
If so, I don't understand how WL is calculating the closed equity. Here is an equity curve from my system, along with the closed equity and closed equity DD.
I see why the closed equity DD is so small -- what I don't understand is why the closed equity looks nothing like the Equity+Drawdown% chart! ALL positions are closed every day. How could the open/closed equity be so different!? The "Strategy Equity" line in the Closed Equity chart matches the "Equity" line in the Equity+Drawdown% chart. The closed equity is 2-3x larger than the Strategy Equity! How can that be if all positions are closed every day??
Very confused...
Gary
Size:
Color:
The closed equity isn't larger, it's at best misaligned. Which build of Visualizers do you have installed?
Size:
Color:
Oh and BTW: the "Closed Equity" and "Strategy Equity" lines on the Closed Equity chart both say they end at just about $175M -- even though the "Strategy Equity" line is below the $150M level!
And if you change the scale to log, the "Closed Equity" line changes but the "Strategy Equity" line doesn't!?
Something is NOT right here.
Size:
Color:
See above.
Size:
Color:
Um. I think it's the "Extra Performance Visualizers," in which case it's 2009.12.
I updated to the 2010.05 version -- no change.
Size:
Color:
And it's more than just misaligned. I picked a date to compare: on 1/2/09, "Strategy Equity" is about $33.9M, according to the tooltip popup. This agrees with the equity curve in Equity+Drawdown%. "Closed Equity" on that same date is over $105M!
Size:
Color:
Try updating to 2010.09, there's a fix for that misalignment. Let me know how it goes there please.
Size:
Color:
How? The Extension Manager only offered 2010.05. The Update Now button is grayed out. The "More Extensions" link isn't there.
On the Extensions webpage there is a "Performance Visualizer library" (not the "Extra Performance Visualizers" I already have) with a 2010.09 date. But I downloaded the WLE file and it requires WL6.
EDIT: Oh, and I told it to show "Other Extensions" and it showed a "Community Performance Visualizers Pack" with a 2010.09 date. But that also requires WL6.
Size:
Color:
Yes, Wealth-Lab 6 is now required to install this and many other extensions.
Size:
Color:
OK, I upgraded to 6. Now the script I was running on WL5.6 won't run; it says "Strategy must set RiskStopLevel in order to use Maximum Risk position size."
1. It *DOES* set RiskStopLevel, and it worked just fine in 5.6.
2. It does this even if I set the position sizing to 1 contract, or fixed dollar size, or anything else.
Size:
Color:
Aha -- pilot error, at least partly.
If you just click "Go," it produces that (misleading) error.
If you enter the editor and Compile, it tells you that Community.Indicators is missing.
So back to the Extensions...
With the current release the misalignment has been fixed -- both curves use the same scale, including when you switch to log scale.
But the closed equity is still significantly higher than the "Strategy Equity," and that still makes no sense to me. Nor do I understand why (in this particular example) the "Closed Equity" goes flat 4 weeks before the end of the test, even though the trade listing shows over 60 opened and closed trades during that period! The growth of the "Strategy Equity" during that time accurately reflects the profits made during that period. So why did closed equity go flat?
Size:
Color:
Re: missing - reinstall Community.Indicators to get rid of the message.
Did you restart after installing Visualizers 2010.09? If you did already, could you help me reproduce what you're seeing?
Size:
Color:
Yes, I reinstalled Community.Indicators, and I did restart after installing Visualizers.
I can't seem to replicate this behavior in any of the standard systems. I'll open a ticket and submit my system that shows the behavior.
Size:
Color:
OK. I see the data loading range already but please also indicate the symbols and the data provider(s).
Size:
Color:
It seems to be specific to baskets of futures. Run it on a basket of stocks, run it on individual futures, and the closed equity looks sensible. Run it on a basket of futures and you get behavior like you see above.
I'm using text data files for the futures so I'll include those in the ticket.
Size:
Color:
QUOTE:
So why did closed equity go flat?
The "plateau" indicates there were open trades that weren't closed.
QUOTE:
It seems to be specific to baskets of futures.
Thanks for the hint. Ran many MSBs of various systems on two futures portfolios.
1. On a mixed portfolio which includes futures symbols not defined in Symbol Info Manager, I see an occasional closed equity running higher than the open equity.
2. On a straight portfolio of 20 futures, each one defined in Symbol Info Manager, both equity lines went almost head-to-head.
My current suggestion would be to check that all your futures symbols are defined properly in the Symbol Info Manager tool i.e. it's not a mixed DataSet.
Size:
Color:
btw, found a minor bug (to be fixed) - closed equity didn't account for entry/exit commissions.
Size:
Color:
QUOTE:
The "plateau" indicates there were open trades that weren't closed.
But there **AREN'T** any. I'm looking at a test that shows a closed-equity plateau from 4/9 to 5/28 (the end of my 15min data). Meanwhile the Trades listing shows all 100 trades in that period being opened and closed on the same day. (Actually some are entered the night before, then exited the next evening, but all are closed within 24 hours.) The only open trade in this test is the last trade, entered on 5/28.
I'm 99.99% sure all futures symbols in this test are defined in the Symbol Info Manager. I just ran a test with a smaller DataSet (8 symbols) and verified that all 8 of them were in the Symbol Info Manager. (The profits corresponded to the point values I specified in the SIM.) With the smaller list of symbols the closed-equity errors weren't quite as severe, but they were still obviously wrong.
The fact that this only happens with MSBs of futures, and the bogus plateaus, make me suspect more bugs in the visualizer. The fact that I can only make it happen with my system makes me wonder if I've got something wrong there too...
Size:
Color:
I already made the source code open in the Wiki. It would be appreciated if you find any other [than not honoring commissions] bug in the closed equity calculation.
Size:
Color:
Sorry, Eugene, I just can't. I've already spent WAY more time on this than I should have, just isolating the problem. I can't spend a whole bunch of time learning the code.
Size:
Color:
No problem. Having some more clues (the data used, data loading range, Symbol Info Mgr settings, Commission/Backtest/Slippage preferences) and some code to reproduce it would be appreciated too.
Size:
Color:
Is the symbol dictionary stored in an XML file or something? I can't find it. If it is, I'll include it with my ticket. Otherwise I'll just have to send a screen shot of my SIM.
Size:
Color:
Sure, in SymbolInfo.xml. See User Guide > Data > Where data are stored, enable hidden file/folder visibility in Windows (Folder options).
Size:
Color:
Got it. I'll get a ticket in.
Size:
Color:
The problem has been identified and a workaround is coming in the next build.
Size:
Color:
Eugene,
Just curious can you provide more details? I saw some weird stuff in there awhile back but never got time to step through it.
Thanks.
Dave
Size:
Color:
Becoming aware of some "gotcha" in PosSizer development helped me understand the cause of a couple of long-standing closed equity bugs in Visualizers, and a possible workaround.
Basically, one shouldn't use EntryBar/ExitBar in PosSizers (and Visualizers as I realized yesterday). Checking for EntryBar/ExitBar equality might fail because the different historical DataSets aren't synchronized when backtesting. Checking for the date with EntryDate/ExitDate rather than the bar number should work.
Size:
Color:
Interesting, thanks for the info.
Dave
Size:
Color:
I have only recently learned about the system's DD closed stats and visualizer. Are DD and DD (Closed) calculated the same way, i.e. from the peak of the value for that particular trade?
I am trying to understand how to use these to rank strategies that are otherwise similar in other metrics but have better scores in one or the other type of DD, but not both. Is Closed DD a more important metric than DD to rank a strategy, particularly in the risk dimension? I appreciate any thoughts you have on this topic.
Size:
Color:
QUOTE:
Are DD and DD (Closed) calculated the same way, i.e. from the peak of the value for that particular trade?
Drawdown is calculated from the peak of the
equity.
DD (Closed) is also calculated from the peak of
closed equity.
Closed equity is calculated by taking the starting capital and adding (or subtracting) the PnL of closed trades only. It does not consider the value of open positions on each bar, only taking into account the value on the exit bar instead.
Size:
Color:
Eugene, thank you for correcting my misunderstanding of closed DD calculation. Now that I understand it, I am wondering what the practical application of this metric is. I can see how for fully in/out trading strategies it could be indicative of worst-case financial downside risk. But for strategies that are portfolio-based, there is usually a mix of open and closed (cash or equivalent) equity. Not sure where I could get a real-time report on my current closed equity if I wanted it. Financial service providers, like Fidelity, uniformly report account value that includes both types of equity.
Size:
Color: