# Buy LO & Sell HI - Optimal Strategy

The optimal trading strategy is to buy low and sell high. This is easier said than done, and many of us invest a lot of effort experimenting with strategies in an attempt to get closer to this end. In this paper, we construct a hypothetical optimal strategy, analyze its returns and construct an econometric model to capture its time dynamics. Next, we use the model to forecast the conditional returns and compare them with returns of actual strategies. Finally, we discuss their application in stop-loss optimization for actual trading strategies.

## Optimal Strategy’s returns

In this paper, we will use the daily returns of S&P 500. The data set covers all data points between Jan 1st, 2000 and May 9th, 2009. As in our white-paper ”Part 1 – Strategy returns”, the strategy’s returns are for buying the security at the market daily low (LO), and selling it at daily high (HI).

$$r_t=\mathit{ln}(\frac{S^{HI}_t}{S^{LO}_t})=ln(S^{HI}_t)-ln(S^{LO}_t)$$

Where:

• $S^{HI}_t$: The underlying security daily highest price
• $S^{LO}_t$: The underlying security daily lowest price

Throughout the day, the underlying security price may reach its daily high before or after it hits its daily low. The buy and sell decision is linked to the price level rather than time in the day, so if the price hits HI first, we short the underlying then cover later on.

In the figure above, please notice that the weighted moving average (20-days) is moving in a similar pattern as the exponential weighted volatility (EWV).

Examining the strategy’s returns distribution, we find that it has a significant positive mean, low volatility, positive skew, and it has a very heavy right-side tail.

Furthermore, we look at the P&L profile for this strategy (assuming 20K investment/capital at risk) at market close and max/min values throughout the day:

This strategy represents the best outcome ever for a strategy that buy/sell S&P 500 Index. Also, the worst outcome ever for a strategy would be the reverse of the best strategy; buy at the high and sell at the low. All strategies that trade the same underlying on a daily basis would fall somewhere in between.

Please note, as we factor in the trading frictions (e.g. transaction cost, Taxes, etc.), the returns and P&L for all strategies would suffer. For the sake of our discussion, let’s ignore them for now.

### Analysis

The log daily returns described above don’t show signs of time trend, and the generating statistical process can be assumed stationary (weakly). Next, let’s examine the Correlogram:

In the graph above, there a strong evidences of serial correlation. Using the PACF plot, the correlation is strong up to 8th lag. Please note the decay of ACF is relatively slow, which indicate long-memory characteristics in the underlying process.

We propose an ARMA(8,3)-based model:

Examining the model for any bias, we test the residuals’ distribution characteristics and compare them with the model assumptions.

The residual analysis shows a significant ARCH effect. The volatility is not as time-invariant as ARMA model assumes. There is more information of the volatility time dynamics to be inferred here, but this would not affect the conditional mean.

Unlike the WMA series, the ARMA conditional mean time series moves in sync with actual returns. There are few occasions where actual return spike beyond the value predicted by ARMA. This is due primarily to the fat-tail ARCH effect in the residuals.

### Analysis - II

Let’s revisit the simple strategy outlined in “strategy’s returns and P&L” white-paper. In this strategy, we bought the security at market open and sold it at market close. First, let’s examine it visually with the series above.

In this figure, we plotted the Open-Close log daily returns (blue line), and the ARMA model conditional mean (and its negative value for worst strategy). The ARMA forecast wraps the strategy returns almost entirely.

### Analysis - III

In practice, people used the HI-LO spread as a measure of the daily volatility, but can we use the ARMA model returns for this purpose?

Using the same strategy in II, we used EGARCH model to capture the dynamics of the conditional volatility and compare it with the ARMA model returns.

In the scatter plot, the EGARCH volatility (vertical axis) correlates very well with the HI-LO spread (horizontal) for the majority of the range. Please note that for high volatility, the correlation is weakening.

### Application

Obviously, the ARMA returns serves as a benchmark for best and worst case scenario at any given day, and it can be a proxy for volatility, but what else can we use it for?

• Proposition I - Stop-loss optimization.
• Proposition II –limit order optimization.

We’ll look at the first proposition now, and leave proposition II for later discussions. For stop-loss optimization, we would like to set the stop price at a dynamic level that maximize our average P&L while limiting the maximum P&L draw throughout the day.

The stop-price is set as follow:

• $$r_t=\mathit{ln}(\frac{(S^{Stop}_t)}{(S^{open}_t)}=\mathit{ln}(S^{Stop}_t)-(S^{open}_t)=-K\times r^{ARMA}_t$$
• $$S^{Stop}_t=S^{open}_t\times e^{-K\times r^{ARMA}_t}$$
• $$S^{Stop}_t=\frac{S^{open}_t}{(e^{r^{ARMA}_t})^K}$$

Where:

• $K$: Constant multiplier
• $r^{ARMA}_t$: Conditional mean return forecast of the HI-LO strategy
• $S^{Stop}_t$: Stop price

The maximum daily P&L draw (assuming partial shares and no slippage) is expressed as follow:

$$\textrm{P&L}^{max}_t⁡_{Draw}=(S^{open}_t-S^{Stop}_t)\times N=\frac{(S_t^{open}-S_t^{Stop})\times A}{(S_t^{open})}=(1-e^{-K\times r_t^{ARMA}})\times A$$

Where:

• $A$: Trading capital

In the graph above, the optimal setting for stop-price is slightly below the open-market price, but not at the open price (to avoid getting election every day). We chose 0.1% as the multiplier (K), and, now, the new P&L has an average of \$41 gain and \$134 standard deviation with maximum draw of 0.01%. Please recall that the average P&L without the stop-loss order has an average of \$0.96 loss and \$275 standard deviation with P&L drawdown of %9.

The graph below shows the new strategy’s returns (blue), and the optimal strategy (HI-LO) ARMA model forecast.

# Other Considerations

In our earlier discussion, we ignored the transaction costs and we assumed we invested all our capital in the strategy, which implies we can buy/sell fractional shares.

Aside from mutual fund accounts, a trader can only buy whole number of contracts.

1. Transaction cost

The transaction cost refers to bid-ask spread, slippage, and brokerage fees. We would probably need to factor those expenses into our return and P&L to better understand the true-viability of the strategy.

We have used one price to buy/sell the underlying security. In practice, there are two prices: Bid – price for selling the security, and Ask/Offer – price to buy the security. The price we use is the mid-price. The difference between the Bid-Ask prices is usually few ticks, but, it can vary for different securities and market condition. Please, note for a full-round (Buy and Sell), we are actually paying for this spread.

Slippage is the difference between the filled price and the best bid/ask price when market order was placed. The slippage is usually few ticks, and it depends on the market general condition (liquidity, volatility, etc.), underlying security, etc.

The fee structure varies significantly across brokers, traded asset, order type (market versus limit order), order size, and any special agreement your firm has with their primary broker. Check your broker’s fees schedule.

2. Slippage
3. Brokerage Fees
2. Non-fractional shares

# Conclusion

A hypothetical strategy that buys at the lowest price and sells at the highest price may be impossible to construct in practice, but it can reveal vital information to any strategist. For INSTANCE, it can serve as a simple benchmark, a reliable volatility forecast, and/or a signal to optimize other strategies (e.g. stop-price).