+1 888 340 6572

The Real DrawDown

Just a little while before I was delighted by the informative and complete strategy reports provided by Omega - especially compared to the poor reports of Metastock. But all changes - times come when searching for top profits and exponential equity curves becomes ousted by routine searching for risk minimization in the troubled market waters. When starting to study and implement position size management algorithms I was surprised to discover that most values from Omega reports have instantly lost all practical meaning! For instance, the DrawDown value in absolute units. If a system starts a test period with $10.000 and finishes it with $150.000, then what does a DrawDown of 6.800 mean? Is it a terrible drawdown equal to 68% of starting capital, an acceptable 4,5% of the last trades or what? Omega keeps silent - probably to keep us healthier.

A little sidetracking and something on Position sizing
I've been in trading for a long time and don't plan to stuff my pockets with cash and quit tomorrow. So all I am doing in the field of money management is limited to position sizing - and, furthermore, only decreasing the size, no leverage ever. In the extreme case a position may be equal to the limit, but most usual it would be equal to only a part of the funds I assign to trading a particular equity. So to find this optimal size we need to know what maximal adverse drawdown is possible with the given strategy.

Since the same methods of position sizing may (and should) be used in different trading systems, it would be preferable to implement them as separate Easy Language functions called on at due time. As an example I will provide codes for two MM-functions. In one the amount of equity bought is determined by a simple variation of the FixedFractional method (opening a position based on a fixed part of the account), in the other the position size is controlled by volatility. I'd make a reservation at once - definite coding might vary zdepending on the market traded. For instance, these codes are optimized for thrading lots of 100 shares, long trades only, execute on Close price, starting capital = $10.000, profits reinvested, no leverage.

Appendix 1. This function calculates the number of shares based on fixed fraction of equity per trade.
{$MM_Fract (function)}

Inputs: Capital(Numeric), {Initial Capital}
Lot(Numeric), {Minimum Lot size}
Fract(Numeric); {fixed fraction of equity per trade in percent}
Vars: Equity(0), Num(0);
Equity = Capital + NetProfit; {Total equity}
Num = floor(Equity*Fract*0.01/Close/Lot)*Lot; {Number of shares}
if close <> 0 and Num > Equity/close then
Num = Equity/close;
if Num < Lot then Num = 0;
$MM_Fract = Num;


Appendix 2. This function calculates the number of shares to trade based on risk-volatility model.
{$MM_Volat (function)}

Inputs: Capital(Numeric), {Initial capital}
Lot(Numeric), {Minimum Lot size}
LenVolat(Numeric), {Period ATR}
Risk(Numeric) ; {Percent of total capital under volatility risk}
Vars: Volat(TrueRange), Equity(0), Num(0);
Volat = Xaverage(TrueRange, LenVolat);
Equity = Capital + NetProfit; {Current equity}
if Volat <> 0 then
Num = floor(Equity*Risk*.01/Volat/Lot)*Lot; {Number of shares}
if close <> 0 and Num > Equity/close then
Num = Equity/close; {Number of shares with minimal risk}
if Num < Lot then Num = 0;
$MM_volat = Num;

Now we need to add lines responsible for controlling the number of shares bought on each signal. For the Fixed Fractional strategy add the following:

Inputs: Capital(10000), {Initial capital}
Lot(100), {Minimum shares in 1 Lot}
Fract(50); {Fraction % of equity per trade}
Vars: Num(0);
Num = $MM_Fract(Capital, Lot, Fract);

For the risk/volatility strategy:

Inputs: Capital(10000), {Initial capital}
Lot(100), {Minimum shares in 1 Lot}
LenVolat(14), {Length of average volatility}
Risk(1); {Risk in percent of volatility}
Vars: Num(0);
Num = $MM_Volat(Capital, Lot, LenVolat, Risk);

Correspondingly, the buy commands in the signal codes must be completed with:
... Buy Num Shares at Close;

Please pay attention that in the first case the position is always opened as 50% of the current account (Fract=50), in the second case the position size is determined by 1% of the account for 14-period ATR (Risk=1, LenVolat=14)/ Those values were chosen to provide approximately the same profits form both methods on the same data and with the same strategy. In those cases with both methods of position sizing the average risk per trade is about 2% of the account.
As the "basic" system I've used a simple system based on the price channel breakout indicator (also known as the "Nick Rypock Trailing reverse") on hourly XXX data from January 1998 to July 2001

After adding the links to money management functions to the signal code we have two strategies with the same algorithm of signal acquisition but with different position sizing routines. On comparison the profit values and profit curves for the test period are very similar:



Dark blue line - the Fixed Fractional strategy equity. Blue line- risk/volatility strategy equity.

Yet if we look at a standard Omega strategy report we won't get a comprehensive answer about either position sizing methods. Omega's in-built algorithms allow to analyze only two money management methods - fixed number of contracts and fixed sum of money. As a result, the values fed out appear to be meant for cheating and pacifying the user in regard to possible risks, not for objective evaluation of the possible adverse factors that are bound to pop up somewhere on the road to wealth.

The first thing I felt was missing was the percentile DrawDown expression in percents of the account traded.

Here comes the real DrawDown!

We'll consider a drawdown the result of a series of adverse trades that keeps a new peak from appearing on the equity curve of the trading system. Adverse trades include more than just losing - profitable trades that do not create a new, higher equity value may be included in drawdown periods. Again, we don't care for the absolute value of the drawdown. A drawdown of $10.000 on a $200.000 account will be 5% and hardly a source of distress, but a drawdown of $10.000 on a $20.000 account will probably be far beyond acceptable limits. So our principal goal will be determining the drawdown as a percent of the account current size.

This cannot be achieved in Omega no matter how hard you try - all drawdowns are in absolute values. Something we might use - the UnderWater Equity is calculated in percents, but for some reason only monthly, disrupting the picture completely. There may be a long discussion as to whys and hows, but a bitter answer is evident - the industry of getting naive people to overfit their curves is much, much more profitable compared to stocks trading per se. So we just have to see what can be done.

Luckily Omega can export practically any kind of information to a text file to be processed in other applications. Let's then define what tasks are there to be solved:

· Define the current equity, considering the starting capital and profits from trades.
· Define the peak of the equity curve (top account size) from which we'll calculate the percentile DrawDown.
· Calculate the current percentile DrawDown in a series of adverse trades.
· Calculate the maximal percentile DrawDown for the period.

It would be wise to use an additional Easy Language function to perform all calculations and create a .CSV file that can be later processed in Excel.

Appendix 3. This function calculates and exports strategy percentage Profits, Equity and DrawDowns.
{$DD_Report (function)}

Inputs:Capital(Numeric); {Initial Capital}

Vars: Trades(0), Equity(0), EquityPick(0), AbsPercProf(0), EqPercProf(0), DD(0), MaxDD(0);

Equity = Capital + NetProfit;
Trades = TotalTrades;

{Calculate closed trade percentage profit}
If EntryPrice(1)<>0 and Equity<>0 then begin
AbsPercProf = (ExitPrice(1)-EntryPrice(1))/EntryPrice(1)*100;
EqPercProf = PositionProfit(1)/(Equity-PositionProfit(1))*100;
End;

{Calculate closed trade percent DrawDown}
If Equity > EquityPick then EquityPick = Equity;
If Equity < EquityPick Then DD = IFF(EquityPick=0,0,-100*(EquityPick-Equity)/EquityPick) else DD = 0;
If DD < MaxDD Then MaxDD = DD;

{Output report}
If barnumber = 1 then
Print(File("C:\DD_report.csv"), "Ticker",",","Strategy",",","Interval",",","Date",", ","Trades",",","Init_Capital",",",
"Equity",",","EqPick",",", "Profit $",",","AbsPercProfit1 %",",","EqPercProfit %",", ","Trade_DD%",",","Max_DD%");

If Trades <> Trades[1] then begin
Print(File("C:\DD_report.csv"),
GetSymbolName+ "," +GetStrategyName+","+NumToStr(BarInterval,0)+"," + ELDateToString(Date)+"," +NumToStr(Trades,0)+","+
NumToStr(Capital,0)+ ","+NumToStr(Equity,0)+","+NumToStr(EquityPick,0)+","+ NumToStr(PositionProfit(1),2)+","+
NumToStr(AbsPercProf,2)+","+ NumToStr(EqPercProf,2)+","+NumToStr(DD,2)+","+ NumToStr(MaxDD,2));
End;

$DD_report = 1;

Now add in the end of the strategy code Value10 = $DD_Report(Capital); o have all the data after charting the strategy exported to a file named C:\DD_report.csv.
Probably only two columns here require explanations - the AbsPercProfit is the percentile profit or loss that could be achieved in the trade if all the available funds were fully used. The EqPercProfit is the percentile profit or loss achieved "really" with the position sizing active.

This file may be plotted in Excel in a variety of ways. but it's more interesting to compare the strategy results using different money management techniques. To do so I've placed reports from both systems on separate Excel file sheets and compared them. The equity curves were already shown above, this is what the DrawDowns look like:


Dark blue line - the Fixed Fractional strategy equity. Blue line- risk/volatility strategy equity. Please notice how deep were the FixedFractional equity losses in the beginning of the period - the crisis-ridden summer and autumn of 1998. For that period volatility-based methods were clearly preferable, but in the right part of the plot that advantage disappears. Now it is clearly visible how much the given adverse period hurts our account in percentile values. The FixedFractional's maximal losses were over 12%, while the risk/volatility method never lost over 10% of the account in the whole period - while the overall profits were the same. One can draw all kinds of conclusions, but this article is not devoted to comparing MM methods, but to presenting the strategy results in a way fit for further studies. One can gain additional useful information by comparing the profits for every separate trade for the different position sizing methods. The diagrams below show the test period shortened to January 2000-July 2001.


Blue columns - the Fixed Fractional strategy profits/losses in percents of the account, red columns - the risk/volatility strategy profits/losses. Furthermore, one can use the AbsPercProfit column to evaluate the effect of the given MM method on every trade. In the case of Fixed Fractional it makes no great sense - with using 50% of account the profit or loss from every trade will be about half of the maximal possible. The risk/volatility method provides an insight on the performance of the capital used:


Blue columns - the probable profits/losses with maximal capital use, red columns - the risk/volatility strategy profits/losses. All results in percents of the current account size.

Again, I indicate that comparing definite money management methods belongs in a separate study, while here is provided a way to extract from Omega the necessary information for further study. The Excel file those examples were based on can be downloaded here (there is no macros, etc., alltransformations to be performed manually). The data from the DD_report.csv for vever strategy is pasted to separate "Report 1" and "Report 2" sheets. The "Profit 1" and "Profit 2" sheets are used to compare the AbsPercProfit and EqPercProfit values of the strategies, i.e. performance of the capital. The "Profit Compare", "Equity Compare" and "DD Compare" sheets are used to compare, correspondingly, the profits, equity and drawdowns of the money management methods. The ranges of the input data for the plots are to be corrected manually in every separate case.