*By Richard Sparrow, CFA, Advanced Execution Services, Credit Suisse*

Imagine a hiring manager in the following situation. She is evaluating candidates for an opening, and she can meet with a fixed number of candidates. After each meeting she needs to immediately decide to a) hire that candidate and stop looking, or b) reject that candidate and keep interviewing.

How many candidates should she meet with before deciding one to pick?

This is a fairly well-known mathematical problem (said to originate in the 17^{th} century mathematician Johannes Kepler’s attempt to optimize his dating), and lies in a branch of mathematics called optimal stopping theory.

Surprisingly, the problem has a fairly simple solution. Given an applicant pool of *n, *the hiring manager should automatically reject the first *n*/*e *candidates, and stop looking once she meets someone better than all those she has already. In this case *e* is the mathematical constant known as Euler’s number, approximately 2.71828. This will give her the best candidate 1/*e*%, or 37% of the time.

So if there are 10 candidates she should automatically reject the first 3; if there are 100 she should reject the first 36. Keep that in mind when you are advised to be quick to apply to a job opening!

When we think about using or building algorithms to trade equities, a similar question arises: The question of how long to wait, or ‘how patient should I be?’ is maybe not asked as often as it might be, but it is crucial to best execution.

For example, if I am buying a stock, how long should I wait at the bid in order to capture the spread? In this instance, we are looking for the optimal point in the tradeoff between immediacy (cross the spread), and price improvement (wait until our resting order gets to the front of the queue and gets hit).

Another way to look at this is to ask how much ‘leeway’ a strategy should be granted from its target participation rate at any point in time. The strategy may fall behind its participation rate while waiting on the passive side of the order book, but how far should we let it fall behind?

Once we think of this concept of ‘patience’ or ‘leeway’ in a strategy, one can see how important a factor it is in achieving best execution. Consider the two price and volume **figures 1a and 1b**.

The figure 1a on the left shows a Thai stock with a wide bid/ask spread, deep order book queue, and irregular liquidity. Urgency aside, the optimal way to trade this stock would be to wait on the passive side of the order book, and be patient as your passive child slices make their way to the top of the order book. The spread should only be crossed if the strategy predicts an imminent adverse price move.

Conversely, the Japanese stock on on the right exhibits a tight bid/ask spread, high intraday volatility, and more consistent liquidity. The optimal way to trade this name would be to stay close to your target participation rate. Allowing too much leeway vs. your target participation rate may mean falling too far behind, exposing you to execution risk if the stock were to make a sudden unfavorable move. As a result the strategy would eventually need to ‘catch up’ to its target participation rate by trading more at unfavorable prices.

We can see from the above examples that assigning a static leeway, for example allowing strategy participation to deviate by a fixed 5% in either direction, is probably the wrong approach. A better approach might be for strategies to take into account a individual stock’s typical trading characteristics in order to establish how much leeway to allow. For example, **figures 2a and 2b **show the black line as our target trajectory and the dotted lines as our minimum and maximum allowable volume, which might represent an approach to optimize leeway for the two stocks above.

However, despite clear benefits offered by this approach of assigning individual stock leeway based on historical characteristics, there are limitations to this method as well.

**Figure 3** shows the average and range of intraday volatility for HSI stocks, which is far from constant over the day. This suggests a strategy assuming that intraday volatility is constant for a given stock may not be making optimal decisions.

Furthermore, there are seasonal factors and external events, such as this past spring’s market disruption, that might lead stocks to deviate from their normal volatility on any given day. As we can see from **figure 4** which shows volatility from early 2020, trading conditions can change significantly over time, so assuming these factors to be constant on a longer-term basis will also generate suboptimal results.

Ideally, a strategy would recognize the prevailing conditions for that stock at any given time and make the appropriate decisions with regards to leeway from the target participation rate.

At Credit Suisse, we have addressed this by developing a concept of ‘Dynamic Leeway’.

Our Dynamic Leeway model uses an intraday volatility prediction model overlaid with current bid/ask spread conditions to apply the appropriate amount of leeway for current market conditions. This Dynamic Leeway model is then used as an input for all applicable strategies to ensure benefits are shared across the execution platform.

The intraday volatility prediction model uses a sophisticated machine learning framework that looks at live market data, and also uses a subset of pre-identified patterns and features that have proven to be reliable indicators of future volatility.

Once we have our predicted value for near-term volatility, we look at current bid/ask spread vs. historical spread to further fine-tune the current optimal leeway. This avoids the risk of a ‘catch up’ signal triggering a spread-crossing decision amid an abnormally wide spread.

The model is designed to work as a real-time risk control component across our strategies. In cases where the stock is stable, we can take more risk in our execution in order to capture the spread. In cases where the stock is volatile, we are less willing to take timing risk in our execution and stay close to the target participation rate.

As an example, the Hong Kong stock in **Figure 5 **clearly exhibits variation in intraday volatility, with periods of stability interspersed with periods of fast order book moves and price dislocation. As you can see from the output of our dynamic leeway on the lower graph, we reduce the variance vs. target participation amid high volatility, while increasing leeway during stable periods.

As you can see, in this case applying a dynamic leeway would have enabled a better execution outcome than a static leeway, even one that had been tailored for that stock’s average trading characteristics.

To summarize, our new Dynamic Leeway provides an effective means to ensure our AES strategy decision-making is tailored to the wide range of trading circumstances found throughout Asia Pacific, and the trading model should help the user achieve their best execution goals.

Unfortunately it is not yet able to help with your hiring decisions.

*This article first appeared in the Q4 issue of GlobalTrading. *