Skip to content
All library documents

Optimizing Sharpe-Weighted Trading Utility in Supervised Learning

Article Quant Q&A · Author: Lucas Morin

Summary

The document frames the Jane Street market prediction task as choosing whether to take each opportunity using anonymized features, trade weights, and realized outcomes. Its objective combines aggregate profit with a clipped Sharpe-like factor, so a classifier trained only to predict whether an individual outcome is positive may not optimize the competition’s stated utility. The post describes alternatives, including portfolio construction after classification, direct utility optimization, and redesigning the target, while noting practical concerns such as gradient-based optimizers and limited visibility into trade-level variance.

The answer proposes treating a parameterized trading rule as an optimization problem: apply the rule to training data, calculate the resulting utility, and search for parameters that improve it. A simple illustrative rule sums selected standardized features and trades when the sum crosses a threshold; selecting useful features becomes a feature-selection problem. The proposal is conceptual rather than a tested result, and the source data are no longer available to the respondent, so the appropriate features and rule complexity remain unknown.

Key ideas

  • A positive-outcome classifier may not maximize a utility that weights aggregate profit by a clipped Sharpe-like ratio.
  • A parameterized trading rule can be evaluated directly using the competition utility as its objective.
  • A simple rule can combine selected standardized features and compare the result with a threshold.
  • Feature selection is one practical subproblem when optimizing such a rule.
  • The proposed approach is illustrative and is not supported by reported empirical results.

Tags

Full text
# Optimising returns weighted by Sharpe ratio in the context of Supervised Learning


# Optimising returns weighted by Sharpe ratio in the context of Supervised Learning












In the Kaggle Jane Street market prediction competition we are put in a Supervised Learning Framework to deal with 'trade opportunities'. That is, we are given instances of previous trade opportunities with associated (anonymised) features, a 'weight' for the trade and a realisation ('resp') that can take negative values. We will be given other trade opportunities with associated features and weights and we have to determine a binary outcome for each trade : take action or pass.

The goal is to optimise an utility function that is the sum of profit, weighted by a clipped Sharpe ratio.

More formally, we need to optimise on a test set :

$$ u = min(max(t,0),6) \Sigma p_i $$

Where :

$$ p_i = \sum_j action_{i,j} * weight_{i,j} * resp_{i,j} $$

And :

$$ t = \frac{\Sigma p_i}{\sqrt{\Sigma p_i^2}} * \sqrt{\frac{250}{|i|}} $$

( $|i|$ being the number of day in the test set.)

From publicly available ressources, most people have taken a purely statistical learning path. That is : determining a binary target by taking 'resp' above 0 (profitable trade) and using pretty standard classifiers to predict that outcome and output a binary action, without even acknowledging the sharpe ratio ponderation. Some people started to take the ponderation into account by using a higher threshold for accepting a trade, but that's it.

I am trying to bridge the gap between this ML formulation and my (old) background in quantitative Finance.

I have considered three different routes :

- Keeping a simple binary target and an associated loss that doesn't take into account the sharpe ponderation, then somehow build 'portfolios' and an optimal risk frontier that would allow me to take trade that are near it.

- Keeping a simple binary target but integrating the utility function as an optimisation target. I am not even sure this could unfold as most optimizer seems to rely on gradient / hessian.

- Redesigning a target that would take into account that ponderation. However that appears difficult as most features are anonymised, so that I can't really identify some measure of variance at an individual trade level.

Are there any ressources to deal with such a formulation of a trading problem ?

## Answer by Enrico Schumann (score 0)

https://quant.stackexchange.com/a/77856

(Too long for a comment.)

One possibility would be to tackle it as a more-or-less straightforward optimization problem. Suppose you have a rule, which takes as inputs some parameters, and returns a decision to take a particular trade or not.

For a fixed set of parameters and training data, that rule maps into a set of accepted trades, which map into a numerical value of your utility function (which contains your mean/variation ratio). With this mapping in place, you optimize: search through the parameters of your rule until a good value of the objective function is found.

One cannot access the data anymore, so I do not know how the provided features looked like. But suppose they could be standardized, then an extremely-simple rule could be this: if the sum of k particular standardized features for a given trade is greater than a constant (zero, say), do the trade. So now you'd only need to identify those k features (i.e. the columns of the dataset), which is a selection problem for which effective algorithms are available.

One could of course use a much more complicated rule, but the key point is to write the utility function directly into the objective function when optimizing.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.