Table of Contents
Fetching ...

FlowHFT: Imitation Learning via Flow Matching Policy for Optimal High-Frequency Trading under Diverse Market Conditions

Yang Li, Zhi Chen, Steve Yang

TL;DR

FlowHFT tackles the problem of adapting high-frequency trading strategies across diverse and volatile market regimes by integrating imitation learning with flow matching. It introduces a two-component framework: a flow matching policy backbone that imitates multiple experts and a grid-search-based fine-tuning module that calibrates actions to current conditions, enabling rapid millisecond-scale inference. The approach demonstrates that the pretrained policy can match or exceed individual expert performance and that finetuning yields further gains, with robustness to abrupt price jumps due to sequence-level planning. Across jump-diffusion price dynamics and Hawkes-based order arrivals, FlowHFT achieves superior profitability and risk-adjusted performance compared to traditional models and RL baselines, while also showing favorable scaling as more experts are incorporated.

Abstract

High-frequency trading (HFT) is an investing strategy that continuously monitors market states and places bid and ask orders at millisecond speeds. Traditional HFT approaches fit models with historical data and assume that future market states follow similar patterns. This limits the effectiveness of any single model to the specific conditions it was trained for. Additionally, these models achieve optimal solutions only under specific market conditions, such as assumptions about stock price's stochastic process, stable order flow, and the absence of sudden volatility. Real-world markets, however, are dynamic, diverse, and frequently volatile. To address these challenges, we propose the FlowHFT, a novel imitation learning framework based on flow matching policy. FlowHFT simultaneously learns strategies from numerous expert models, each proficient in particular market scenarios. As a result, our framework can adaptively adjust investment decisions according to the prevailing market state. Furthermore, FlowHFT incorporates a grid-search fine-tuning mechanism. This allows it to refine strategies and achieve superior performance even in complex or extreme market scenarios where expert strategies may be suboptimal. We test FlowHFT in multiple market environments. We first show that flow matching policy is applicable in stochastic market environments, thus enabling FlowHFT to learn trading strategies under different market conditions. Notably, our single framework consistently achieves performance superior to the best expert for each market condition.

FlowHFT: Imitation Learning via Flow Matching Policy for Optimal High-Frequency Trading under Diverse Market Conditions

TL;DR

FlowHFT tackles the problem of adapting high-frequency trading strategies across diverse and volatile market regimes by integrating imitation learning with flow matching. It introduces a two-component framework: a flow matching policy backbone that imitates multiple experts and a grid-search-based fine-tuning module that calibrates actions to current conditions, enabling rapid millisecond-scale inference. The approach demonstrates that the pretrained policy can match or exceed individual expert performance and that finetuning yields further gains, with robustness to abrupt price jumps due to sequence-level planning. Across jump-diffusion price dynamics and Hawkes-based order arrivals, FlowHFT achieves superior profitability and risk-adjusted performance compared to traditional models and RL baselines, while also showing favorable scaling as more experts are incorporated.

Abstract

High-frequency trading (HFT) is an investing strategy that continuously monitors market states and places bid and ask orders at millisecond speeds. Traditional HFT approaches fit models with historical data and assume that future market states follow similar patterns. This limits the effectiveness of any single model to the specific conditions it was trained for. Additionally, these models achieve optimal solutions only under specific market conditions, such as assumptions about stock price's stochastic process, stable order flow, and the absence of sudden volatility. Real-world markets, however, are dynamic, diverse, and frequently volatile. To address these challenges, we propose the FlowHFT, a novel imitation learning framework based on flow matching policy. FlowHFT simultaneously learns strategies from numerous expert models, each proficient in particular market scenarios. As a result, our framework can adaptively adjust investment decisions according to the prevailing market state. Furthermore, FlowHFT incorporates a grid-search fine-tuning mechanism. This allows it to refine strategies and achieve superior performance even in complex or extreme market scenarios where expert strategies may be suboptimal. We test FlowHFT in multiple market environments. We first show that flow matching policy is applicable in stochastic market environments, thus enabling FlowHFT to learn trading strategies under different market conditions. Notably, our single framework consistently achieves performance superior to the best expert for each market condition.
Paper Structure (27 sections, 21 equations, 6 figures, 7 tables, 2 algorithms)

This paper contains 27 sections, 21 equations, 6 figures, 7 tables, 2 algorithms.

Figures (6)

  • Figure 1: Visualization of FlowHFT's Input Observation Sequence and Output Action Sequence
  • Figure 2: This figure illustrates the training of a flow matching policy. The inputs are various market situations. For each situation, the best expert is chosen from a pool of models. These optimal market-expert pairings are then used to train the flow matching policy, which operates as a vector field. This field maps the distribution of market conditions to a corresponding optimal action distribution.
  • Figure 3: This figure shows the action generation. The neural network of flow matching policy (left) provides initial bid/ask outputs. A grid search (right) identifies adjustments ($\Delta$bid,$\Delta$ask) to refine these actions. Combine the initial result and adjustment together to get the final results.
  • Figure 4: Parameters settings of market simulation
  • Figure 5: Scaling analysis showing the relationship between the Number of Instructors (expert models) used in training FlowHFT and its resulting performance, as measured by Sharpe Ratio (blue bars, left y-axis) and Maximum Drawdown (red line, right y-axis).
  • ...and 1 more figures