Serving the Quantitative Finance Community

 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Nonparametric Dependence Measures in Quantitative Trading

January 4th, 2018, 7:49 am

Dear Fellow Traders,
 
I am collecting links, papers and other resources on applications of nonparametric dependence measures in systematic trading. All stages of decision making are relevant: signal generation, strategy development and risk management. Two main examples of nonparametric dependence measures are Spearman’s rho and Kendall’s tau. These measures are based on ranks and, as such, they are naturally suitable for trading, where we care more about the portfolio going up/down and less about the actual magnitude of the movement.
 
The two measures are robust in the sense that they are not sensitive to big infrequent spikes in the data. For that reason they are more stable than Pearson’s correlation. The robustness may be a blessing in some situations (where “smoothing” is necessary) and it may be a curse in others. I use nonparametric association measures in a few places in my strategies but their usefulness is certainly much wider. So I would like to increase my “scope” and, perhaps, write a nice systematic web-resource one day... Any information would be appreciated. To get the ball rolling, here is the first block of links.
 
1] Optimizing a portfolio of ETFs using “mean-variance” principles. Instead of employing the regular covariance matrix of ETFs, the authors employ its modification based on Spearman's rho.
 
2] Pairs trading of a specific class of US stocks. Kendall’s tau and Spearman’s rho are used to select the pairs. Several trading strategies are considered, including cointegration-based trading and copula-based trading.

3] Pairs trading of ETFs. Kendall’s tau is used to select the pairs. Copula-based strategy is considered.

Thank you.
  
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 4th, 2018, 2:07 pm

These measures are based on ranks and, as such, they are naturally suitable for trading, where we care more about the portfolio going up/down and less about the actual magnitude of the movement. 
You will lose a lot of money that way.

Magnitudes of movements matter more than percentages of wins and losses.

Only gamblers count how often they win but ignore how much they lose.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 4th, 2018, 2:57 pm

These measures are based on ranks and, as such, they are naturally suitable for trading, where we care more about the portfolio going up/down and less about the actual magnitude of the movement. 
You will lose a lot of money that way.

Magnitudes of movements matter more than percentages of wins and losses.

Only gamblers count how often they win but ignore how much they lose.
Dear Traden4Alpha, I never said that magnitudes of movements do not matter. They are very important in any P&L analysis. However, "percentages of wins and losses" matter even more when assessing the quality of the trader. At the end of the day/week/month, first and foremost, we care whether we are any good as prop traders. We care whether our signals are strong, whether our call was correct and we have made money on the trade... And then we care how much. 

Being right only 50.5% of the time (or less) is dangerous positioning. And when it comes to being right only 1% of the time, well, shorting black swans may never pay off before one dies, even though in expectation it does pay off. Life is short. Professional life especially. 
 
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 12:38 am

Percentages of wins and losses is irrelevant as long the magnitude of a trader's wins sufficiently and consistently exceeds the magnitude of their losses. And the simplest combined measure of magnitudes of wins, magnitudes of losses, and the percentages is just the average return. A trader can have a terrible win-loss ratio and yet still consistently make money. Why look at win-loss when it doesn't tell you what matters?

What's funny is that most prop traders fail to beat the market. And on the minutes-and-hours timescales of most active traders, the implicit buy-and-hold strategy of tracking the market is actually wrong 50% of the time. Thus this example of what you call "dangerous positioning" actually beats most prop traders and shows that win-loss percentages really don't matter financially.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 8:21 am

Percentages of wins and losses is irrelevant as long the magnitude of a trader's wins sufficiently and consistently exceeds the magnitude of their losses.  And the simplest combined measure of magnitudes of wins, magnitudes of losses, and the percentages is just the average return.  A trader can have a terrible win-loss ratio and yet still consistently make money...  And on the minutes-and-hours timescales of most active traders, the implicit buy-and-hold strategy of tracking the market is actually wrong 50% of the time.
Trade4Alpha, assessing your trading performance using "minutes-and-hours timescales" is a path to ruin. You should look at P&L over the lifetime of the trade. Sure, many of my trades go into red the moment I put them in but, in the end, I make money on more than 80% of them... If, after the dust settles, the trader makes money on only 50.5% of his trade ideas, he is not that good, He must work on his skills even if his overall P&L is positive... Also, this discussion is sensitive to how one defines a trade. If your trader "is consistently making money" then, effectively, he is making money on most big sub-portfolios. And the constituents of each sub-portfolio are not determined independently. So, arguably, they are part of the same trade idea.

To summarize: if you think something and then see that you are right only 50.5% of the time, stop and think better. 
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 8:36 am

That's not true! I'd be very fine doing 10.000 trades of which 50.0% make on average a $2 profit and 50.0% a $1 loss. Also, I'd be happy to have a 50.5% probability of making on average $1 profit and 49.5% a $1 loss. 
Looking at the performance conditioned on the sign of the P&L is one of many choices but what matters more is the risk adjusted performance of all trades combined, the statistical significance of the excess return given the number of observations you have, and the stability of that.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 8:45 am

Outrun, you are talking in the language of introductory finance books. Sure, diversification, diversification. What you are saying is a trivial probabilistic result. However, in practice, you will not find "10.000 trades of which 50.0% make on average a $2 profit and 50.0% a $1 loss" over a reasonably short time-frame. All of this is idealization... Are you actively trading markets? Did you ever try to make money on 10,000 identically distributed trades?
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 8:56 am

I've done more that 10.000 trades in my life for sure.

With skewed p&l distribution the fraction of positive/negative trades is kind of useless, and that's especially so with *low* frequency trades since it won't even be statistical significant.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 9:18 am

I've done more that 10.000 trades in my life for sure.
And were those trades identically distributed, like in the example that you mentioned? Were you able to consistently make money over the years? And if yes, are you really correct only 50% of the time (or maybe more often actually)?
With skewed p&l distribution the fraction of positive/negative trades is kind of useless, and that's especially so with *low* frequency trades since it won't even be statistical significant.
I am no template but, for example, my trades are not "low-frequency". I put in 0-20 trades a week. But still, every trade is different. And in practice nobody knows the actual distribution of the next trade. No asymmetric idealization like "50.0% a $2 profit and 50.0% a $1 loss"... Potential asymmetry of portfolio returns is a well-documented issue. So one needs to make sure that the expected returns and Sharpe ratio are positive and large, as much as live testing and backtesting allow. However, this is not enough. Separately, one needs to make sure that the signals are strong and he is more often right than wrong. Other trading philosophies may deliver in a given year but may fail to detect structural changes in the market and abruptly deteriorating performance.
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 10:03 am

10 trades a week, -or- 500 observations a year is a good case to discuss the statistical side of things:
1) what ratio of positive / negative trades do you need to have the positive be significant (95%) more than negative?
2) In year #2, what way shift in ratio do you need to see to label it as a statistical significant structural change? 
3) does that ratio say *anything* about your P&L distribution?

This splitting trades into positive/negative trades and looking at the ratio is naïve. P&L are very skewed, it only takes one big hit to reset the little profits of 10 trades, right?
But apart from that: trades are not the natural unit of evaluating a trading strategy. You might go long and decide every day to stay long. You make some P&L,.. how do you attribute that P&L to your sequence of daily decisions that led to only one trade? This is typically modelled as a markov decision process where one tries to attributing P&L to actions you might take conditioned on the states (of the market), under uncertainty.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 10:46 am

But apart from that: trades are not the natural unit of evaluating a trading strategy. You might go long and decide every day to stay long. You make some P&L,.. 
If I just keep / modify an old long position, this counts as just one trade idea, typically... I'm afraid I do not see how you prove that "trades are not the natural unit". They are certainly a natural unit for assessing the performance of trading signals. Could you elaborate please?... Also:

1) As high as possible. I personally am not perfectly comfortable trading even the 80% success rate, precisely because "one big hit to reset the little profits of 10 trades". So what I was trying to say is that the success rate is a very important characteristic of a trading style but not the only one.

2) NA. "shift in ratio" is just one component in more complex analytics. But it is a piece of information.

3) A high ratio says that the P&L dynamics has passed only one of many tests, but a serious one.
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 11:33 am

About P&L on a trade level not being a natural view:

A trading algorithm model can be seen as one that has the following elements:
* State "S". This is both a state estimate of the market (in the 80s this could be "the 30day MA  > 90day MA") as well as *your* state: you might be long 1 unit, have a sell order in the orderbook and have 3.50 cash position.
* Actions "A". This is the set of things you can do: you can send a market order, send a limit order, cancel a limit order, etc etc
* A probabilistic model P(s'|s,a) that tells you what possible states s' you and the market end up in when you start in state s and take action a.
* An immediate reward R(s,a,s') that you get when 'things moved from state s to state s' and taking action a.
* A policy, .. your trading algorithm.. p(a|s) which tells you what action you should do given a certain state. There are couple of alternative variant possible here, .. another option is to have a value function v(s) that you can use to estimate the value of actions.

An example in words you might have sent a limit buy order to the exchange (=action), the market went down and your order was filled (s to s' transition, both the market and your change in position). The immediate reward/loss you get while moving from state s to s'via action a might be transaction cost and P&L based on market-to-market valuation of your new position against market prices at s'.

However you don't want to look just at immediate reward because it's typically always negative in trading (because of transaction cost etc), so instead you look at discounted future sum of rewards. It's also here where you can add penalties for risk

In this framework trades are resultants of sequences of actions, but there typically isn't a one-to-one correspondence between actions and trades. Actions can also create value without even going through a trade: sending an limit order to the market changes the market -it might drive the price up or change the probability of other orders getting executed-, canceling a limit order might be very valuable, it might save you getting a fill that you no longer want.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 11:54 am

Thanks for the elaborate answer. So you are putting everything into the framework of reinforcement learning. However, a big part of reinforcement learning is when you do not know the distribution of the data and have to learn on the run. This is contrary to your 

"you don't want to look just at immediate reward because it's typically always negative in trading (because of transaction cost etc), so instead you look at discounted future sum of rewards."

Which "discounted sum", Outrun? Do you really know it? Do you really know what its distribution is going to be 3 months from now?... Are you sure you will live long enough and your portfolio will not blow up or experience severe drawdown? 

Also, I never claimed passion for "immediate reward". In fact, in this thread I said to Trade4Alpha: "assessing your trading performance using minutes-and-hours timescales is a path to ruin. You should look at P&L over the lifetime of the trade."
Last edited by staassis on January 13th, 2018, 6:19 am, edited 1 time in total.
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 12:08 pm

Tomorrow, after the huge comet strike, everything can be completely different, but that's orthogonal to "the P&L sign of a trade start to finish" is a good measure -or not- discussion, no?
My *main* problem is that that any good strategy can very easily be turned into a very bad strategy with a higher ration of trades with a positive P&L. Erasing magnitude of P&L and only looking at sign is a stupid measure. I would *always* want to have both magnitude *and* statistical significance. There are tons of trades who thing that having 55/100 trades with a positive P&L is somehow informative. To me it's the opposite, a strange measure that gives the illusion of "good" and it's not even significant, so not even worth looking at, feels like a scam.
 
User avatar
staassis
Topic Author
Posts: 27
Joined: April 12th, 2014, 5:10 pm

Re: Nonparametric Dependence Measures in Quantitative Trading

January 9th, 2018, 12:17 pm

Erasing magnitude of P&L and only looking at sign is a stupid measure. I would *always* want to have both magnitude *and* statistical significance. 
I agree completely. You need to have both: 1) high success ratio (strong signals) and 2) high Sharpe ratio (return magnitudes that work for you). I said this in my 2nd response to you. However, in my opinion, the success rate is more important. It is highly correlated with your quality as a prop trader. For a prop trader the most important task is to survive. See who survives over the decades. What is the success ratio of Warren Buffet or George Soros? 50.5%? No.