Trade Graphs | MAE vs PnL plot missing negative y-axis components
Author: superticker
Creation Date: 12/14/2019 5:46 PM
profile picture

superticker

#1
Could someone please tell me where all the negative y-axis components went on the P/L% vs.MAE/MFE plot below? Of course, I would like to think my strategy never suffers any losses, but in truth, that's probably a little over presumptuous. :-)
profile picture

Eugene

#2
The MAE/MFE plot always uses the absolute values. That's why it looks like that.
profile picture

superticker

#3
QUOTE:
The MAE/MFE plot always uses the absolute values.
The image below comes from https://www.mql5.com/en/articles/2704 What I do notice about their image is that they are plotting "MFE/MAE vs. Profit". Wealth-Lab says "MFE/MAE vs. Profit" on the tab label, but then it reverses the axes and plots "Profit vs. MFE/MAE" instead. I do see negative numbers on their Profit axis (x-axis) below.


I have to confess, it's not clear to me which is the dependent and independent variables here. I'm "guessing" Profit would be dependent on MFE/MAE (and not the other way around), but that's really a matter of opinion in this case. At any rate, I would be consistent with what others are doing in the literature; after all, we want to be able to compare our results with what's published in the literature.

In scientific journals, one's article would be rejected for folding over a negative axis; that's just never done. But this isn't science.
profile picture

Eugene

#4
QUOTE:
The image below comes from https://www.mql5.com/en/articles/2704

An interesting find. My source of inspiration was a book by Emilio Tomasini and Urban Jaekle called "Trading Systems". If you take a look at pp. 66-69 in Google Books you'll see how they create this graph. I guess it's the folding over a negative axis enables to visualize the "loss diagonal" as they call it.

As they put it, "Whether the dollar amount indicated along the y-axis is a profit or loss is determined by the colour and the direction of the small triangles. Keeping the trades clustered on the same graph makes it easier to figure out how much unrealised loss must be incurred by a trade before it typically does not recover."

QUOTE:
WL says "Profit vs MAE" on the tab label, but then it reverses the axes and plots "MAE vs Profit" instead.

You're right, this may be a bit confusing.
profile picture

superticker

#5
I think the reason we are both struggling with this plot is because there is not any direct "market-based" relationship with MFE/MAE and Profit/Loss. As a result, there isn't any dependent and independent variable here in the first place, so which variable belongs on the x- and y-axes remains a question. And you'll never get a linear relationship between the x and y variables because no market-based relationship exists. So why are we plotting it in the first place? That's the real and most interesting question. (Are we even asking the right question? Probably not.)

Let's take the exit code of my strategy as an example. It employs a complex MACD exit. When that triggers, it "attempts" to sell with limit orders. If that fails over enough attempts, then it hits the chandelier stop band. Now it tries to sell more aggressively with bracket orders. When that fails enough times, then it does a market sell. This strategy design forces a weak correlation between MFE/MAE and Profit/Loss, but this correlation is weak and indirect. Should we be plotting something else instead? I'm not sure. What the MFE/MAE plot does give us is a lumped model of how the overall exit process is working in our strategy. Perhaps there's a better metric to quantitate this behavior; I don't know.

What I would do is:
1) Plot "Profit vs. MFE/MAE", which you are doing now. This order makes a "little" more sense.
2) I would fix the tab label so it reads "Profit vs. MFE/MAE", and not the other way around.
3) I would add the negative region to the y-axis (Profit axis) so it agrees with how we would publish in it a statistics journal. You could add a checkbox to fold the negative axis over, but I think folding it over only confounds the presentation.

For extra credit, we can both try to think of a better method to quantitate the merits of our exit strategy that would provide a more linear relationship with the Profit axis. But even if we did come up with a better method that better linearizes the resulting scatter plot, we are never going to get a solid linear relationship because no direct relationship exists with anything relative to Profit since this is a fuzzy problem.
profile picture

Eugene

#6
While the book by Tomasini/Jaekle isn't a statistics journal, I've implemented the visualizer to match their idea. Which is to graph all the trades on the chart (as triangles) and determine whether it's a winner or loser by the color of the triangle. They believe that clustering the trades helps figure out how much unrealized loss must be incurred by a trade before it does not recover (usually). My thinking is that Axis Y should read "Absolute P/L% of Position" which it currently does not - and this is confusing.

QUOTE:
2) I would fix the tab label so it reads "Profit vs. MFE/MAE", and not the other way around.

Will do.

QUOTE:
3) I would add the negative region to the y-axis (Profit axis) so it agrees with how we would publish in it a statistics journal.

I put it on my todo list for future consideration. If I find it adds value then it could be added as an option.

Thanks.
profile picture

superticker

#7
Thanks for adding the negative Profit axis as an option. And I'm confident the scientific and statistics journal subscribers are clever enough to glean what they need from the plots without folding an axis over.
profile picture

Eugene

#8
QUOTE:
Wealth-Lab says "MFE/MAE vs. Profit" on the tab label, but then it reverses the axes and plots "Profit vs. MFE/MAE" instead.

That's not true. I've double checked this when revisiting the task and can tell you that MAE/MFE has always been plotted on the X Axis while the Axis Y reflects the absolute value of system's P/L %.

QUOTE:
3) I would add the negative region to the y-axis (Profit axis) so it agrees with how we would publish in it a statistics journal.

I experimented with adding it to the code but for some reasons I prefer to leave it as is. But thank you for your suggestions, they are appreciated.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).