Algorithmic Day Trading as a Yield-Generating Product

Using Backtests to Convert Algo Strategies

Before we begin, let’s clarify what we mean by something yield-generating. In order for a product to be yield-generating, it must satisfy two conditions:

  1. Has an expected return on capital that we can estimate. This does not mean that it is riskless. Even the safest of investments can result in potential loss, even if just in purchasing power. It also does not mean indefinite, just as other yield instruments have a duration.
  2. Mostly passive operation once money is put in. While we would ideally want zero maintenance, we’ll loosen this property, as a lot of the better yields in crypto (as any “farmer” might tell you) require some proactivity and activity.

Stabilizing the Strategy P&L Returns

In particular, we want to ensure a level of stability in the returns and P&L of any running model. We do so by modifying how we measure the trading model’s score in the backtest. In addition to the usual P&L returns, we’ll also use two more metrics:

  1. The backtest daily sharpe ratio. This variation of the sharpe ratio is commonly used by HFT firms. It calculates the average daily return over its standard deviation (note: we’re ignoring the risk-free rate term here). Or more simply, a daily sharpe ratio of 1 implies that we can reasonably expect that our strategy configuration in production can make between 0 and double the average daily return from backtest. The higher the daily sharpe ratio increases, the better and the more likely we would expect to get closer to the average daily return from our backtest results.
  2. The backtest traded volume. Although this is related to the sharpe ratio, we can often expect more signal than noise if our strategies are trading a lot in backtest vs making one or two trades (i.e., law of large numbers). This is why we focus on “day trading” on purpose. This high-frequency subset generally has a high number of trades in a day, with smaller positions and shorter holding periods.
Figure 1. Ideal strategy P&L. We want to limit drawdowns (circled).

Demonstrating Yield Through Market Making

Let’s use market making to show how we can do this. Here are changes we might make for our three strategy variables (and two new ones we’ve added to try to reduce drawdown sizes):

  1. Reference Price. As in our backtesting trading article, let’s assume this is a moving average of recent orderbook mid-prices of some time window. In order to encourage a higher number of trades and volume, we would ideally want this to be faster. So, we’d want to throw in lower values here. Perhaps that means we’d need lower parameter values such as 5 and 10 min vs 1, 6, or 12 hours.
  2. Offset. Given the shorter time windows for the reference price calculation, we’d also want to get closer to the average. So, we’ll likely have much lower numbers for the offset parameters. There’s no hard-and-fast rule here, but 1–50 basis points probably would be more desirable than >= 500 bp.
  3. Lean. Similarly, we would probably want shorter holding times and take winners sooner than later. The lean algorithm can differ dramatically. However, let’s assume a basic version with two parameters that control at what position we start leaning and how far back or forward, depending on the position. We may want to consider leaning forward the side that takes us out of a position sooner and more aggressively, even if that means taking a smaller win, but at a much earlier time.
  4. Max Position. This new parameter lets us cap our max position. Because we are expecting a good amount of turnover for our position due to parameter settings proposed for the reference, offset, and lean, we can keep the max position values smaller. This also helps us determine how much capital can be put into each configuration of the strategy.
  5. Max Loss Threshold. This new parameter triggers a new execution behaviour. Let’s assume it’s effectively two parameters: if we have a losing position hit the max loss threshold (first parameter), we will reduce our position (second parameter). To reduce the size of drawdowns, we may want to experiment with lower values for both parameters to cut losses sooner and to get down to a much smaller position in case the price movement against us continues.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store