Papers › MacroHFT: Memory Augmented Context-aware Reinforcement Learning On High Frequency Trading

MacroHFT: Memory Augmented Context-aware Reinforcement Learning On High Frequency Trading

20 Jun 2024arXiv:2406.14537archive 2025-07-28

Chuqiao Zong, Chaojie Wang, Molei Qin, Lei Feng, Xinrun Wang, Bo An

High-frequency trading (HFT) that executes algorithmic trading in short time scales, has recently occupied the majority of cryptocurrency market. Besides traditional quantitative trading methods, reinforcement learning (RL) has become another appealing approach for HFT due to its terrific ability of handling high-dimensional financial data and solving sophisticated sequential decision-making problems, \emph{e.g.,} hierarchical reinforcement learning (HRL) has shown its promising performance on second-level HFT by training a router to select only one sub-agent from the agent pool to execute the current transaction. However, existing RL methods for HFT still have some defects: 1) standard RL-based trading agents suffer from the overfitting issue, preventing them from making effective policy adjustments based on financial context; 2) due to the rapid changes in market conditions, investment decisions made by an individual agent are usually one-sided and highly biased, which might lead to significant loss in extreme markets. To tackle these problems, we propose a novel Memory Augmented Context-aware Reinforcement learning method On HFT, \emph{a.k.a.} MacroHFT, which consists of two training phases: 1) we first train multiple types of sub-agents with the market data decomposed according to various financial indicators, specifically market trend and volatility, where each agent owns a conditional adapter to adjust its trading policy according to market conditions; 2) then we train a hyper-agent to mix the decisions from these sub-agents and output a consistently profitable meta-policy to handle rapid market fluctuations, equipped with a memory mechanism to enhance the capability of decision-making. Extensive experiments on various cryptocurrency markets demonstrate that MacroHFT can achieve state-of-the-art performance on minute-level trading tasks.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.14537")

Code

Syntology Ran 8 of 9 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 1 ran · honoured contract; 7 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ZONG0004/MacroHFT officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 8 ran; 1 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
7ran
1unverified

Licence: 9 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ZONG0004/MacroHFT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calculate_alpha ZONG0004/MacroHFT/RL/agent/low_level.py official repository ran fingerprinted no licence file found · pointer only · a98414e84339e5f4 · report
custom_kernel ZONG0004/MacroHFT/RL/util/memory.py official repository ran fingerprinted no licence file found · pointer only · d00220b1a44c6187 · report
get_ada ZONG0004/MacroHFT/RL/util/utili.py official repository ran fingerprinted no licence file found · pointer only · 189b2bbac443b4f1 · report
get_epsilon ZONG0004/MacroHFT/RL/util/utili.py official repository ran no licence file found · pointer only · 250e2eda775973f7 · report
get_slope ZONG0004/MacroHFT/preprocess/decomposition.py official repository ran fingerprinted no licence file found · pointer only · 1036b901aff50585 · report
get_slope_window ZONG0004/MacroHFT/preprocess/decomposition.py official repository ran no licence file found · pointer only · 0822f07194e8e3ae · report
modulate ZONG0004/MacroHFT/model/net.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · 62fcb3912a967a50 · report
smooth_data ZONG0004/MacroHFT/preprocess/decomposition.py official repository ran fingerprinted no licence file found · pointer only · f18c412f5cd4b096 · report
calculate_q ZONG0004/MacroHFT/model/net.py official repository unverified no licence file found · pointer only · b959adc87c598b55 · report

Tasks

Algorithmic TradingDecision MakingHierarchical Reinforcement LearningReinforcement LearningReinforcement Learning (RL)Sequential Decision Makingreinforcement-learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Adapter

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections