Why not use the Sortino Ratio instead of the Sharpe Ratio? This only uses downside deviation in its calculation and thus directly includes the idea of drawdown only in your loss function.
In your given example, the black return line would have a higher Sortino Ratio value than that of the red return line, so you could directly optimise for this ratio.
Response to Comments
Re: "But here is the thing: the daily returns for the red line (both positive and negative) are exactly the same as for the black line"
Well, yes, maybe in this example that is true, but I believe this is an unrealistic example. In my opinion the returns streams from two, different and unrelated sets of trading rules will not produce identical returns distributions. It is far more likely that the distributions will be different but the summary statistics will be indistinguishable.
By way of example I present the following stylised chartwhich somewhat follows the OP's chart with regard to beginning and ending values.
Strategy A (Black line) is constructed from two different Gaussian distributions, one for positive returns (mean = 40, std = 1) and the other for negative returns (mean = -0.25, std = 0.25) and sorted to produce a highly desirable "stair stepping" equity curve with minimal drawdowns.
Strategy B (Red line) is another set of Gaussian returns with mean and standard deviation equal to that of the combined returns of strategy A and sorted so that all negative returns occur first for a large drawdown, followed by an all positive returns drawup.
The summary statistics for these are:
A_mean_return = 11.323
A_std_return = 18.236
A_downside_deviation_return = 0.2205
Sharpe_A = 0.6209
Sortino_A = 51.354
B_mean_return = 12.024
B_std_return = 19.134
B_downside_deviation_return = 10.714
Sharpe_B = 0.6284
Sortino_B = 1.1223
The Sharpe Ratios are not exactly the same due to the nature of the random generation of the returns, but are similar enough to be statistically indistinguishable. However, the Sortino Ratio does clearly distinguish strategy A as being the more desirable.
If, by some fluke, your different systems produce identical Sharpe and Sortino Ratios then you are running into the sort of problem that is illustrated by Anscombe's Quartet whereby you will have to resort to "graphical" methods. To my mind, the simplest way would be a gain-to-pain ratio calculated thus:
Total_Gain / Max_Drawdown
For the chart above these values are
A_gain_pain_ratio = 149.81
B_gain_pain_ratio = 3.7397
which, obviously, also shows that strategy A is the better one without needing classical statistical measures to tell us this fact.
Response to comments, part 2
My strategy A does indeed have drawdowns and the Octave/MATLAB code given below should enable you to replicate the above and see for yourself.
pkg load statistics ;
## Create Strategy A returns
x_d = normrnd( -0.25 , 0.25 , 250 , 1 ) ; ## drawdown distribution
x_u = normrnd( 40 , 1 , 100 , 1 ) ; ## drawup distribution
A = [ x_d(1:100) ; x_u(1:50) ; x_d(101:200) ; x_u(51:75) ; x_d(201:250) ; x_u(75:100) ] ; ## distributions combined
A_equity_value = cumsum( [ 10000 ; A ] ) ;
A_mean_return = mean( A ) ;
A_std_return = std( A ) ;
A_downside_deviation_return = std( x_d ) ;
Sharpe_A = A_mean_return / A_std_return ;
Sortino_A = A_mean_return / A_downside_deviation_return ;
## Create Strategy B returns
B = normrnd( A_mean_return , A_std_return , 350 , 1 ) ;
B = sort( B ) ;
B_equity_value = cumsum( [ 10000 ; B ] ) ;
B_ix = find( B < 0 ) ;
B_mean_return = mean( B ) ;
B_std_return = std( B ) ;
B_downside_deviation_return = std( B( B_ix ) ) ;
Sharpe_B = B_mean_return / B_std_return ;
Sortino_B = B_mean_return / B_downside_deviation_return ;
## Gain pain ratio
A_gain_pain_ratio = ( A_equity_value( end ) - A_equity_value( 1 ) ) / max( cummax( A_equity_value ) - A_equity_value ) ;
B_gain_pain_ratio = ( B_equity_value( end ) - B_equity_value( 1 ) ) / ( B_equity_value( 1 ) - min( B_equity_value ) ) ;
if ( ishandle( 1 ) )
clf( 1 ) ;
figure( 1 ) ; h1 = axes( 'position' , [ 0.02 , 0.02 , 0.97 , 0.95 ] ) ;
plot( A_equity_value , 'k' , 'linewidth' , 2 , B_equity_value , 'r' , 'linewidth' , 2 ) ;
title( "Comparison of 2 Strategies' Equity Values Over Time with 'Similar' Moments and Sharpe Ratios" , "fontsize" , 15 ) ;
legend( 'Strategy A Equity Value' , 'Stategy B Equity Value' , 'location' , 'northwest' , 'fontsize' , 15 ) ;
Are you sure that Strat A and B equity over time come from the same return distribution?
No, they do not, but that is the point I'm trying to make and the code makes this explicit. You can have different distributions of returns but the summary statistics of these different distributions can be (almost) identical or indistinguishable from each other, making said summary statistics completely uninformative with respect to choosing between the underlying trading systems.
If you don't like Return / MDD you could try something like Return / Average size of all individual DDs. The denominator in this expression can be adjusted in many ways, e.g. average plus 1 or 2 x standard deviation of DDs.