Median trade return
Author: rbryant
Creation Date: 9/19/2018 8:01 AM
profile picture

rbryant

#1
Dear Eugene and others

Is there an easy way to see the median trade return (rather than downloading and analysing the trade data) rather than the average trade return which is in the performance result, please?

Thanks and kind regards

Rod
profile picture

Eugene

#2
Hi Rod,

I've never encountered "the median trade return". What's the formula? Is there a platform that uses it? Is there a real advantage over the average trade return in using it?
profile picture

Cone

#3
The median would be midpoint in the frequency distribution of the trades (gain), i.e., the 50th percentile. The mean could be influenced more by outliers. Anyway, it's another data point. We display it for Monte Carlo-Lab simulations.
profile picture

rbryant

#4
Hi Eugene

Cone answered your questions. Median is the normal median as per maths, being the middle data point. It avoids the effect of outliers. The average could be affected by some big losses or gains. The median would not be. Some research shows the median is more predictive of a systems future performance.

Can the median trade return please be added in the performance results just under the average trade return please?

Thanks and kind regards

Rod
profile picture

Eugene

#5
Fidelity controls the contents of the built-in Performance tab so tweaking it is beyond our control. But nothing stops us from adding the Median Profit % and Median Profit $ to the Performance+ tab. Look for them in upcoming update of MS123 Visualizers (v2018.10). ETA ~ late next week.

P.S. For now I keep from adding them to MS123 Scorecards (maybe later).
profile picture

superticker

#6
QUOTE:
The median would be midpoint in the frequency distribution of the trades (gain), i.e., the 50th percentile. The mean could be influenced more by outliers.
Well put.

The median takes longer to compute than the average, which is its big disadvantage. But its big advantage is that it's unaffected by outliers, which are commonly encountered in stock prices. The brute force method of computing the median is with a sort, then taking the 50% point within the sorted result as the median. But there are faster ways of computing the median that don't require total sorting.

The Math.Net package (https://numerics.mathdotnet.com/DescriptiveStatistics.html) provides several robust statistical metrics you might also be interested in. In addition to the median, it also provides "Percentiles", which work like the median, but the 50% point is adjustable to different percentages. For example, when computing a resistance band, I'm often interested in the 90th percentile; whereas, WL's Highest() indicator is going to give you the 100th percentile, which is unstable (not robust). If you're into robust statistics, you might look at Math.Net's quartiles functions as well.

The Math.Net package works well with Weath-Lab. I typically create calls to it inside my own DLL library for multilinear regression so only WL compatible data types (like a DataSeries) are exposed to my main strategy, which calls Math.Net indirectly. This makes for cleaner code in the main strategy, and is highly recommended since Math.Net data types (Matrix and Vector) are different than WL data types.

One could easily create a WL indicator that would do Percentile and expose it to WL as a DataSeries type. And WL currently has a PercentRank() indicator, which wouldn't be good for computing resistance bands, but may work for other robust thresholding.
profile picture

Eugene

#7
Just in case, the Performance+ tab shows a related metric called Tail Ratio. It's ratio between the 95th and 5th percentile of the percent-based daily returns distribution. For example, a tail ratio of 0.25 means that losses are four times as bad as profits.
profile picture

superticker

#8
QUOTE:
... the Performance+ tab shows a related metric called Tail Ratio.
That's really neat. Do you know if there's a "Symbols+ tab" that would include a Tail Ratio column?

What I would like to do is delete symbols out of my WL datasets where the Symbols+ tab is saying the Tail Ratio is poor for a given symbol.
profile picture

Eugene

#9
Hmm I think we're getting far from topic again, which is "Median trade return".
profile picture

Eugene

#10
Rod,

Please update (or fresh install if you don't have it) MS123 Visualizers to v2018.10 and restart WLD, then make sure that Performance+ is enabled in Wealth-Lab's Preferences > Performance Visualizers. Then reopen your Strategy for the change to apply. "Median Profit" ($ and %) will appear on the Performance+ tab.
profile picture

rbryant

#11
Eugene

I am sorry I just saw this. Thank you. You and Cone rock.

Regards
Rod
profile picture

Eugene

#12
Rod,

Happy to please.
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).