Frontiers of Peak Sharpe Ratio: data visualization technique

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
Mark Johnson
Roundtable Knight
Roundtable Knight
Posts: 122
Joined: Thu Apr 17, 2003 9:49 am

Frontiers of Peak Sharpe Ratio: data visualization technique

Post by Mark Johnson »

I've found a way to plot the results of a stepped parameter simulation that I think is quite useful. In brief, it's a scatter plot, with (average trade duration) on the X axis, and (some measure of Goodness) on the Y axis. I've been using the Robust Sharpe Ratio as the measure of Goodness in my plots, but you could use anything else that suits your fancy.

This kind of plot is especially handy for visualizing your options; it answers the question "How well does the system perform when trading short term? medium term? long term?" It also helps if you are thinking about trading the same system at several different "speeds", for diversification. Let me illustrate with an example.

Figure 1 shows the stepped parameter simulation used to make these plots.

It varies three parameters, for a total of 149 x 15 x 80 = 178,800 tests. However, some of the parameter combinations you get when stepping parameters over a wide range are nonsensical (exit breakout #days > entry breakout #days). So I eliminated them with a simple filter in the Before Trading Day script.

Code: Select all

IF (entryBreakout < exitBreakout) THEN
	test.abortTest
ENDIF

This quits an individual test immediately and proceeds to the next one. It filtered out 46,215 nonsensical tests, leaving 132,585 reasonable tests.

The After Test script calculates Average Trade Duration and prints it, along with test.robustSharpeRatio, to the Print_Output.csv output file. Then the Print_Output file is imported to your plotting software (gnuplot, in this example) and graphs are produced.

Running Figure 1 and plotting the results, I got Figure 2 below. Let's look at the top panel (green color) first.

The sweep range of system parameters used, gives trade durations between 5 days (at the far left of the plot) and 210 days (at the far right). Each individual test is plotted as a green diamond; there were 132k tests run and therefore 132k diamonds on the plot.

As you would expect, system performance varied as the parameters were stepped. Stop the presses: some parameter-sets performed worse than others (!). The very best performing parameter sets resulted in high Robust Sharpe Ratios; for each trade duration, there is a Peak Sharpe Ratio achieved at that trade duration. The peak Sharpe Ratios are at the very top of the scatter plot (the upper boundary). Taking a hint from Markowitz mean-variance optimization and its "Efficient Frontier", I'm calling the upper boundary of the dots in Figure 2 the "Peak Sharpe Frontier".

In the top panel of Figure 2, point "A" is on the Peak Sharpe Frontier; with a Trade Duration of 25 days, the peak achievable Sharpe with this system and this portfolio and this set of slippage assumptions (et cetera), is about 1.2. Moving to point "B", at Trade Duration = 80 days, the peak achievable Sharpe is about 1.3. And at point "C" (Duration = 210 days), the peak achievable Sharpe is a bit more than 1.5.

I ran two other slippage settings, shown in the blue panel and the red panel of Figure 2. As many authors have told you, many times: SLIPPAGE MATTERS. The three panels tell three different stories. The Peak Sharpe Frontiers of these three panels are collected together on a single plot for easy comparison (Figure 3).

Someone who simulates with "High Slippage" (blue curve, Figure 3) expects to achieve a Robust Sharpe ratio of 1.2 or less. This person's simulations clearly show that the best possible performance is at the longest possible trade duration (210 days), at the far right edge of the plot.

Someone who simulates with "Medium Slippage" (green) however, expects to achieve a Robust Sharpe ratio of 1.3 to 1.5. This person sees the Sharpe Ratio flatten out after trade durations of ~160 days or so.

And someone who simulates with "Low Slippage" (red) expects to achieve Robust Sharpe ratios of 1.6 to 1.7. Furthermore, this person's "optimum" trade duration (max of all available Sharpes on the Frontier) is 30 days! Slippage assumptions have dramatically changed the landscape.

How might a trader USE the Peak Sharpe Frontier curve? One possibility would be to select different trading "speeds" to combine together in a suite, for diversification. For example, the green curve trader might decide to build a suite out of the 30-day trade duration system (@ Sharpe = 1.35), the 100-day duration system (@ Sharpe = 1.25), and the 210-day trade duration system (@ Sharpe = 1.52). Then see whether the combination of these three systems has an even better Sharpe ratio than any of its individual components. And I'm sure other traders will come up with other ways to use this tool.

I hope it proves to be a valuable tool for your research toolbox.

Mark Johnson

Moderator's note: Unfortunately, can't in-line images per Mark's request without also including them as attachments: sorry. Had to create this new topic with only one message to try the experiment; sorry again.
LeviF wrote:Mark,

Thank you for sharing your research. It is interesting that there is a wall where once you get out past 80 or so days in avg trade length, there are no r-sharpes below 1.

Based on my own research, I wouldnt be surprised if testing ATR stops > 4 provided even better results.
RedRock wrote:
LeviF wrote: Mark,

Thank you for sharing your research. It is interesting that there is a wall where once you get out past 80 or so days in avg trade length, there are no r-sharpes below 1.

Based on my own research, I wouldnt be surprised if testing ATR stops > 4 provided even better results.

80 was the magic number used in the famous Aberration trading system. When that was expended, we learned that going longer may be helpful. So many lessons, so many bumps in the road. It may be educational to run this presentation on a domestic portfolio up to 2003ish and compare and contrast the plots before and after this general time-point.

Oh ah.... sweet, MJ.
Attachments
Figure 3
Figure 3
frontiers.png (22.04 KiB) Viewed 4167 times
Figure 2
Figure 2
3panels.png (51.57 KiB) Viewed 4170 times
Figure 1
Figure 1
sysparams.png (24.69 KiB) Viewed 4168 times
td80
Roundtable Fellow
Roundtable Fellow
Posts: 60
Joined: Thu Mar 08, 2007 8:38 pm
Location: Irvine, CA

Post by td80 »

Thank you for sharing Mark. This also leads to an interesting rabbit hole regarding markets with limited liquidity (given a trader's capital allocation). It may be interesting to allocate the high slippage strategy to a less liquid portfolio of instruments, the medium slippage to somewhat liquid instruments, and the low slippage strategy to your really liquid stuff.

Tune continuously based on your capital allocation + current instrument liquidity. So you may have one giant portfolio of instruments split up across the same basic system but with more optimized exit criteria for 3 large cross-sections of the instrument set.

It is a bit of curve fitting (it certainly would be if optimizing on a per-instrument basis), which I am always wary of, but it is also fairly practical if you want to take advantage of markets that may otherwise be ignored due to liquidity (i.e. high slippage) issues.

This all seems rather self-evident after reading your post but as usual I hadn't thought of this particular twist until now. You have certainly created more work for me to do :idea:
Post Reply