Skip to content
All library documents

Adapting Machine Learning Strategies to Medium-Frequency Trading

Article Quant Q&A · Author: Jeremie

Summary

The document asks how to adapt a noisy high-frequency price-direction labeling method to trading at a more ordinary frequency. The cited method uses the stock’s bid-ask midpoint and compares averages over nearby time windows, assigning upward, downward, or neutral labels according to a threshold. This is intended to reduce the noise that would result from labeling every small midpoint change as directional.

The response suggests that machine learning can be applied across strategy types, and singles out order-flow prediction as a relatively accessible use case for neural networks. It mentions logistic regression for short-horizon price jumps and a proposed combination of ARIMA with support vector regression to address nonlinear patterns. These are suggestions, not a tested medium-frequency system: the answer provides no data, performance results, trading rules, or validation procedure. Its discussion of anticipating large orders is a high-level example and does not establish feasibility or execution assumptions.

Key ideas

  • A threshold applied to averages of past and future mid-prices can create directional and neutral labels.
  • The label design aims to filter out small, noisy price movements.
  • Order-flow prediction is proposed as one possible machine-learning application.
  • The response names logistic regression and ARIMA with support vector regression but reports no comparative evidence.
  • A strategy must be evaluated at its intended trading frequency and with realistic execution assumptions.

Tags

Full text
# Trading Strategy adapting to my trading frequency


# Trading Strategy adapting to my trading frequency












> We want to predict the direction towards which the price will change. In this work the term price is used to refer to the mid-price of a stock, which is defined as the mean between the best bid price and best ask price at time $t$: $$p_t = \frac{p_a^{(1)}(t)+p_b^{(1)}(t)}{2}$$ This is a virtual value for the price since no order can happen at that exact price, but predicting its upwards or downwards movement provides a good estimate of the price of the future orders. A set of discrete choices must be constructed from our data to use as targets for our classification model. Simply using $p_t > p_{t+k}$ to determine the direction of the mid price would introduce unmanageable amount of noise, since the smallest change would be registered as an upward or downward movement. lightly different from the previous one. Thus the shortterm changes between prices are very small and noisy. In order to filter such noise from the extracted labels we use the following smoothed approach. First, the mean of the previous $k$ mid-prices, denoted by $m_b$, and the mean of the next $k$ mid-prices, denoted by $m_a$, are defined as: $$m_a(t) = \frac{1}{k} \sum_{i=1}^{k} p_{t-i}$$ $$m_b(t) = \sum_{i=0}^{k} p_{t+i}$$ where $p_t$ is the mid price as described in Equation (2). Then, a label $l_t$ that express the direction of price movement at time $t$ is extracted by comparing the previously defined quantities ($m_b$ and $m_a$): $$ l_t = \begin{cases} 1, & m_b(t) > m_a(t) (1+α)\\ -1, & m_b(t) < m_a(t) (1-α) \\ 0, & \text{otherwise} \end{cases} $$ where the threshold $α$ is set as the least amount of change in price that must occur for it to be considered upward or downward. If the price does not exceed this limit, the sample will be considered to belong to the stationary class. Therefore, the resulting label expresses the current trend we wish to predict. Note that this process is applied for every time step in our data.

Forecasting Stock Prices from the Limit Order Book using Convolutional Neural Networks (link)

The above text explains a labelling strategy for high frequency trading. In my case, I would like to make medium frequency trading using deep recurrent neural network and that labelling strategy. By MFT, I mean that the trading frequency is approximately the same as the trading frequency of a normal trader.

I am looking for a strategy which is adapted for that kind of frequency. I have some well known strategies example, but I don't know which one could be a good start.

> Order flow prediction HFT strategies Execution HFT Strategies Liquidity Provisioning – Market Making strategies Automated HFT Arbitrage strategies Source : https://www.quantinsti.com/blog/automated-market-making-overview/

What could be a good trading strategy for this type of frequency?

## Answer by Theodore (score 5, accepted)

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

Machine learning could be integrated into anyone of these strategies.

Order flow prediction strategies would be the "easiest" of these examples, specifically for integrating neural networks and machine learning. The most widely used method of AI in this field is regression, here are some examples of it in the high frequency field with LOB prediction. Logistic regression can be used for predicting price jumps that happen on an inter-trade basis. The most promising method and one that I am interested in quite a bit is integrating autoregressive integrated moving average (ARIMA) models with support vector regression (SVR). See: A hybrid ARIMA and support vector machines model in stock price forecasting

The use of neural networks and other machine learning techniques can be thought of from the viewpoint of optimisation or enhancement. As far as implementing convolutional neural networks goes, most of those applications have to do with visual imagery analysis. However other types of deep learning strategies are being researched and used in quantitative trading strategies.

Going back to ARIMA models and machine learning, generally the time series forecasting models such as the ARIMA have a hard time dealing with nonlinear data. However, support vector machine (SVM) neural networks do not! They are great for dealing with non linear regression problems. That is where I think you should base your strategy as it seems promising and a bit more robust than the other application of machine learning in this field.

Just reading from the quantinsti blog post...

> HFT order flow prediction strategies try to predict the orders of large players in advance by various means then take trading positions ahead of them and then lock in the profits as a result of subsequent price impact from trades of these large players.

Integrating machine learning into this type of activity is also possible. You can train neural networks to predict when "whale" orders whale be placed and effectively engage in a bit of front running.

Every single one of these HFT strategies we could go through but it simply becomes apparent that integrating machine learning and AI methods into trading strategies is a relatively trivial thing to do. AI is a buzzword, especially on Wall Street.

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.