- ago
Sometimes you may need to look at this type or equity curve (fixed profit/loss equity). It also may be useful to compare them for some cases.
5
1,267
Solved
39 Replies

Reply

Bookmark

Sort
- ago
#1
I had already started adding a Closed equity option to the Equity Curve visualizer but postponed it due to lack of demand. Let's see if this request gets some following. Note that closed equity is computationally intensive even with formula tweaks and can slow down intraday backtests.
1
Glitch8
 ( 10.62% )
- ago
#2
From what I read:

“Closed equity: The value of your trading account without open profits/losses. This is the amount of money you have in your account. It shows the development of your closed trades.”

Isn’t this the same as our Cash Curve?
0
- ago
#3
QUOTE:
“Closed equity: The value of your trading account without open profits/losses. This is the amount of money you have in your account. It shows the development of your closed trades.”

Isn’t this the same as our Cash Curve?


I think no.
I mean this:
- first candle - starting capital.
- second candle if any position closed on it - starting capital + total closed positions profit.
- third candle - if no closed positions here - previous value.
- fourth candle - if no closed - previous value (even if there are positions being open).
- fifth candle - if 1 position closed on it - previous value + profit of this position.


Actually, I don't know what kind of computationally intensiveness Eugene is talking about, as I think of it as a:

All positions sorted by exit date, then getting expanding sum - and then plot it. Maybe some extra calculations are needed in WL7, but in Python it would be very fast)).
0
Glitch8
 ( 10.62% )
- ago
#4
So you ignore the day to day fluctuations of the open positions? Sounds like not very intensive to calculate.
0
- ago
#5
QUOTE:
So you ignore the day to day fluctuations of the open positions? Sounds like not very intensive to calculate.


Something like this.
0
- ago
#6
When looping bar by bar, the nested loop by all positions (sorted by exit date) makes the closed profit calculation slow in any language. Fortunately, in MS123 Visualizers for WL6 the algo was optimized so one could have a chance to notice some slowdown in intraday backtests with large number of positions only.
0
Glitch8
 ( 10.62% )
- ago
#7
I think we can optimize that, much like i did for the By Symbol also in the recent build.
0
Glitch8
 ( 10.62% )
- ago
#8
But I'm having trouble understanding what the practical benefit of this request is? I can't imagine ever wanting to see the equity curve that way. What is the appeal?
0
- ago
#9
The exact trigger to post this request was:

I use some kind of positions' post processing using Python scripts. I tried to compare WL7 equity curve to the one inside my script to make sure I didn't make an error. So I couldn't do that as I use this close method and you do not.


In more common sence, something like: this type of equity curve is a representation of positions'results. So it's a visual instrument to see/control of what's going on with positions'results. Falling equity will tell you undoubtedly about negative trades. You may also compare these two curves - I think a large deviation is reason to think about more efficient trailing or something.
0
Glitch8
 ( 10.62% )
- ago
#10
ok, fair enough.
1
Glitch8
 ( 10.62% )
- ago
#11
If you have any good web pages describing or illustrating this paste them here too.
0
- ago
#12
Suggestion with respect to time-loss in sorting, lopping etc:

Perhaps this could be a user preference to include or not (for backtest or optimizations).

If selected then show/enable the additional checkbox on the Equity visualiser tab - otherwise leave it diabled.

That would retain optimal speed for those who don't require the additional calcualtions.
1
- ago
#13
QUOTE:
If you have any good web pages describing or illustrating this paste them here too.

Our own Wiki page for WL6:
http://www2.wealth-lab.com/WL5WIKI/PVClosedEq.ashx

The screenshot illustrates Replikant's idea quite graphically: "You may also compare these two curves - I think a large deviation is reason to think about more efficient trailing or something."

Activating the item.
0
- ago
#14
Check out B29 for closed equity curve and see if you cand find something - almost sure you can :)
0
Glitch8
 ( 10.62% )
- ago
#15
Personally I think it should be rendered as a line over the current equity curve.
1
- ago
#16
QUOTE:
Check out B29 for closed equity curve and see if you cand find something - almost sure you can :)


Mmm, adding a bit of gamification))).
0
- ago
#17
QUOTE:
Personally I think it should be rendered as a line over the current equity curve.


Agree!

And this new color (blue? green?) does not fit the other two in my opinion.

I would also like to turn on/off equity, closed equity, cash independently. But of course it's not something you can't live without).

If you think there are too many checkboxes) - I think MA one is a bit usless with this fixed rolling window size.
0
Glitch8
 ( 10.62% )
- ago
#18
I'm having a really hard time understanding how Closed Equity is any different than what we depict as the Cash Curve in the Equity Curve. Ive optimized the calculation, and from what my undersatand of Closed Equity is, the result is matching the Cash Curve 100%. Note that this is different than the Closed Equity in Build 29, which I feel is faulty. Replikant, can you show my a picure of how closed versus normal equity would look for a single trade according to your understanding? Note that the Cash Curve, and the Closed Equity depicted below, follow your rules from Post #3.

0
- ago
#19
With its short plateaus, the Cash curve's shape resembles the original idea expressed in particular on this screenshot from version 6. Something that I couldn't reach in V7 with the same algo:
http://www2.wealth-lab.com/WL5WIKI/GetFile.aspx?File=Community.Visualizers%2fPVClosedEq.PNG

Additionally, unlike the Cash curve which accounts for margin interest and dividends, the Closed equity doesn't do this.
0
- ago
#20
QUOTE:
I'm having a really hard time understanding how Closed Equity is any different than what we depict as the Cash Curve in the Equity Curve. Ive optimized the calculation, and from what my undersatand of Closed Equity is, the result is matching the Cash Curve 100%. Note that this is different than the Closed Equity in Build 29, which I feel is faulty. Replikant, can you show my a picure of how closed versus normal equity would look for a single trade according to your understanding? Note that the Cash Curve, and the Closed Equity depicted below, follow your rules from Post #3.


Something like this maybe?

2
Glitch8
 ( 10.62% )
- ago
#22
Thanks, that clears things up.
1
Glitch8
 ( 10.62% )
- ago
#23
But I still cannot fathom what value this brings to the table. So if a buy a position at the beginning of the equity curve and it then tanks to near zero but i still hold it, my closed equity is somehow still my stating capital? Are there any articles anywhere that explains how such a closed equity is useful for analyzing a trading system?

There are other questions too, like what to do with dividends? I suppose they get added to closed equity as they occur?
0
Glitch8
 ( 10.62% )
- ago
#24
I'm feeling that a Closed Equity line isn't providing any more information than WL7's existing Cash Curve. Maybe Closed Equity was a "feature" or products or frameworks that don't offer the detailed Cash Curve of WL7, which gives you a true picture?
0
Glitch8
 ( 10.62% )
- ago
#25
And here, I did find one article referencing Closed Trade Equity Curve. It's using a definition different than the one you supplied. It looks like a graph of trades along the X-Axis (closed trades only) and equity along the right.

According to this, it should be it's own Visualizer, not superimposed over the existing Equity Curve.

https://kjtradingsystems.com/EquityCurveAnalysis.pdf
0
- ago
#26
It's not about why do you need these two types of equities maybe... but if you close position near zero you will be able to open long of 10 times smaller quantity maybe, but if you stay in the position you will stay the same size. So restoring price will fully restore your equity in the second example, but will restore only 10% if your size is 10 times smaller. So if you see normal equity that dip and then restoring - you don't actually know whether it's more like first case or second. Maybe this example looks being far from practical)). Closed equity curve was the only type I used when I was using my own python framework. So real profit of having these two types together is just to be discovered)).

P.S. Closed equity curve is a good way of selling your martingale strategies))).
0
Glitch8
 ( 10.62% )
- ago
#27
See my comment above -
0
- ago
#28
QUOTE:
And here, I did find one article referencing Closed Trade Equity Curve. It's using a definition different than the one you supplied. It's just a normal bar by bar equity curve, but including only the closed trades in the results. Open trades are simply ignored:


Isn't my Excel example stating the same? You add trade result after it's closed.
0
Glitch8
 ( 10.62% )
- ago
#29
Also, can you send me the link to the Python package that generates Closed Equity that you used?
0
Glitch8
 ( 10.62% )
- ago
#30
You Excel example has the X-Axis progressing bar by bar. Not that big a deal I guess but just a different way to visualize.
0
- ago
#31
QUOTE:
Also, can you send me the link to the Python package that generates Closed Equity that you used?



I didn't use some kind of trading framework, but my own. It uses just Pandas framework (it's not about trading, just tables).

Here is an example of how I did it. Closed trades list is the source for this kind of equity.

https://colab.research.google.com/drive/1crp-JaY6amk1JyQFY3e_QX2ujbvqJBfS?usp=sharing
0
- ago
#32
Actually I'm not good at low level for this topic, I prefer something simple, my first equity didn't have datetime X, just expanding sum of trade results).
0
Glitch8
 ( 10.62% )
- ago
#33
OK, here's how it's looking for Build 30 - should be right on the money, and fast!

0
Best Answer
- ago
#34
Nice. Maybe you could give it more contrast for when equity is higher then closed equity?

P.S. I've remembered another possible case - matching real trading result with backtest results. You will use your real trades'results in this case so closed equity will be more helpful.
0
Glitch8
 ( 10.62% )
- ago
#35
I don't think Closed Equity has anything to do with real trades vs backtest results. The Closed Equity trades are still backtest results.

I'm making it so that the normal equity curve gets dimmed out when you enable Closed Equity ...

1
- ago
#36
QUOTE:
I'm making it so that the normal equity curve gets dimmed out when you enable Closed Equity ...


Great!

QUOTE:
I don't think Closed Equity has anything to do with real trades vs backtest results. The Closed Equity trades are still backtest results.


Why not? You got your real trades results, you may easily plot your equiry curve, you can use this curve and WL7 closed curve for visual matching. If you use visual matching for this.
0
Glitch8
 ( 10.62% )
- ago
#37
It's out of scope for the Equity Curve Visualizer. It's intended to visualize a backtest result. Adding your actual trades here was never intended or suggested. We have a separate feature request open around loading your actual trades for analysis into WL7.

Furthermore, no we don't have the actual trade results. To do that we'd need support from the broker APIs to return a HISTORY of placed trades. Some brokers may offer it, some not, but it's not built into our framework at all at this stage.
0
- ago
#38
No-no, I'm not talking about anything like this. WL7 is to show backtest equity only. Real trades equity curve is somewhere in another place).
1
- ago
#39
But it would be great to have this inplace in the future). Like you backtest, analyze backtest results, trade, control that trade results match backtest results, control and analyze real trades results and all of this withing WL7 - would be great.
1

Reply

Bookmark

Sort