Agent Memory with Episodic Retrieval for Financial Decision-Making
Summary
This paper introduces META, a multi-agent framework with episodic memory for financial trading that integrates specialized indicator agents to improve decision-making under market regimes.
View Cached Full Text
Cached at: 09/25/26, 09:31 AM
# Agent Memory with Episodic Retrieval for Financial Decision-Making
Source: [https://arxiv.org/html/2609.28771](https://arxiv.org/html/2609.28771)
Jiang LiuAffiliation:University of Science and Technology of ChinaWenxuan HuangAffiliation:Fudan UniversityXiang ZhangAffiliation:University of British ColumbiaJuntai CaoAffiliation:University of British ColumbiaJiaqi WeiAffiliation:Zhejiang University\*Equal contribution\.
###### Abstract
Large language models \(LLMs\) have demonstrated strong capabilities in financial analysis and reasoning, inspiring recent advances in agent\-based trading frameworks\. While these systems show promise, prior approaches either emphasize long\-horizon forecasting or operate as stateless analyzers, limiting their applicability to the demands of trading in complicated settings\. To address these gaps, we introduce META \(Memory Enhanced Trading Agent\), the first RAG\-like episodic\-memory\-augmented multi\-agent framework for financial decision making\. META integrates a family of specialized indicator agents \(e\.g\., Trend, MACD, Stochastic, RSI, SMA, AVWAP, Heikin\-Ashi\) with a Decision Agent that fuses their reports, and a Memory module that retrieves and updates past trading episodes encoded as market state embeddings with outcomes and reflections\. By recalling relevant experiences and adaptively reweighting signals under similar market regimes, META achieves improved directional accuracy and robustness under short\-horizon evaluation\. Our results demonstrate thatepisodic memoryprovides a powerful mechanism for regime\-aware, interpretable, and low\-latency decision\-making in trading and decision making\. Code of this project is released at[GitHub](https://github.com/KriXord/Agent-Memory-with-Episodic-Retrieval-for-Financial-Decision-Making)\.
Figure 1:Architecture of theMETAmemory system\.The framework consists of three core components: Memory System Establishment, Relevant Memory Retrieval, and Memory Database Management\.## 1Introduction
Building autonomous agents capable of reliable decision\-making in complex, non\-stationary environments remains a central challenge in machine learning\. High\-frequency trading \(HFT\) exemplifies this difficulty: agents must process rapidly evolving, high\-dimensional data under strict latency constraints, where profitable patterns can invert within minutes\([Yang et al\., 2023](https://arxiv.org/html/2609.28771#bib.bib30);[Zhang et al\., 2023a](https://arxiv.org/html/2609.28771#bib.bib34)\)\. Traditional quantitative systems rely on handcrafted logic for low\-latency execution but collapse under regime shifts\. Conversely, Large Language Model \(LLM\) agents demonstrate advanced reasoning ability\([Wang et al\., 2024](https://arxiv.org/html/2609.28771#bib.bib19);[Li et al\., 2023b](https://arxiv.org/html/2609.28771#bib.bib12)\), yet remain*stateless*—each decision made in isolation, without learning from prior outcomes\. This absence of experiential continuity limits adaptability in markets defined by recurrence and volatility\.
We argue that progress in this domain requires agents endowed withexperiential memory, capable of recognizing and reusing structural analogies between past and present market states\([Yu et al\., 2023](https://arxiv.org/html/2609.28771#bib.bib33);[Ji et al\., 2023](https://arxiv.org/html/2609.28771#bib.bib6)\)\. While dynamic memory frameworks such as Mem0 and MemGPT\([Chhikara et al\., 2025](https://arxiv.org/html/2609.28771#bib.bib2);[Packer et al\., 2023](https://arxiv.org/html/2609.28771#bib.bib16);[Xu et al\., 2025](https://arxiv.org/html/2609.28771#bib.bib29)\)enable long\-term reasoning in text\-based tasks, they fail to generalize to the stochastic, high\-dimensional structure of financial time series\. Unlike language, market data evolve as continuous numerical manifolds, demanding memory systems that operate over both symbolic abstractions and quantitative dynamics\. This motivates a new direction: re\-engineering episodic memory for real\-time environments where state representations are not linguistic but numerical and non\-stationary\.
To this end, we introduceMETA\(Memory Enhanced Trading Agent\), a multi\-agent cognitive architecture that reframes trading as a “Perceive–Recall–Synthesize” process\. In thePerceptionstage, specialized Signal Agents extract interpretable technical features from market streams\. In theRecallstage, a Memory Operator performs case\-based retrieval from prior trades to identify historically analogous contexts\. Finally, theSynthesisstage fuses real\-time analysis with retrieved precedents to produce context\-aware trading decisions\. This process is powered by adual\-stream state representationthat separates symbolic indicator vectors \(for reasoning and retrieval\) from normalized price–volume embeddings \(for similarity search\), balancing interpretability and numerical precision\.
Figure 2:The META cognitive workflow, illustrating the interplay of its three core operators\. The process unfolds in stages: \(1\)Perception \(Φ\\Phi\): A distributed ensemble of Signal Agents encodes the market state in parallel\. \(2\)Synthesis \(Π\\Pi\): Real\-time reports are fused with retrieved historical precedents to formulate a decision\. \(3\)Memory \(Ψ\\Psi\): The memory buffer is updated via a reflection\-augmented consolidation cycle\.META is the first cognitive trading framework to embed retrieval\-augmented episodic memory directly into the high\-frequency decision loop\. Its memory operator extends dynamic memory principles\([Chhikara et al\., 2025](https://arxiv.org/html/2609.28771#bib.bib2);[Li et al\., 2023a](https://arxiv.org/html/2609.28771#bib.bib11);[An et al\., 2025](https://arxiv.org/html/2609.28771#bib.bib1)\)to structured numerical domains, enabling adaptive reasoning grounded in market feedback\. Empirically, META achieves substantial gains in profitability and stability over stateless baselines, showing that coupling cognition with memory yields agents that not only react to markets—but*learn*from them\.
## 2Related Work
#### LLMs for Financial Decision\-Making\.
Large Language Models \(LLMs\) are increasingly deployed as autonomous agents for financial trading, analysis, and alpha discovery[Yang et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib30);[Zhang et al\. \(2023a\)](https://arxiv.org/html/2609.28771#bib.bib34);[Wu et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib25);[Gong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib4);[Xiong et al\. \(2026\)](https://arxiv.org/html/2609.28771#bib.bib27)\. LLM\-based trading agents generally follow three paradigms: leveraging sentiment from news and social media[Lopez\-Lira and Tang \(2023\)](https://arxiv.org/html/2609.28771#bib.bib15);[Kirtac and Germano \(2024\)](https://arxiv.org/html/2609.28771#bib.bib8);[Zhang et al\. \(2024a\)](https://arxiv.org/html/2609.28771#bib.bib35), using reinforcement learning \(RL\) to refine policies through simulated trading[Ding et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib3);[Koa et al\. \(2024\)](https://arxiv.org/html/2609.28771#bib.bib9), or employing explicit reasoning frameworks[Ji et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib6);[Li et al\. \(2023b\)](https://arxiv.org/html/2609.28771#bib.bib12);[Yu et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib33);[Zhang et al\. \(2024b\)](https://arxiv.org/html/2609.28771#bib.bib36);[Zhang et al\. \(2023b\)](https://arxiv.org/html/2609.28771#bib.bib39)\. A complementary line of work formalizes such inference\-time reasoning as an explicit search process over intermediate decision states[Wei et al\. \(2026b\)](https://arxiv.org/html/2609.28771#bib.bib23), and documents the broader transition from single\-model prompting to autonomous, agentic systems that plan and act over extended horizons[Wei et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib22)\. Our work, META, advances the reasoning\-driven paradigm with a specialized memory framework for technical analysis\. It uses an “Indicator Vector” \(e\.g\., MACD, RSI\) to retrieve analogous historical scenarios via cosine similarity\. A key contribution is ourMemory Update and Reflectionloop, which refines memory based on trade outcomes, allowing the agent to learn from the performance of technical patterns\. Unlike systems that generate new alpha factors[Xiong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib26);[Wang et al\. \(2023b\)](https://arxiv.org/html/2609.28771#bib.bib20);[Zhang et al\. \(2025a\)](https://arxiv.org/html/2609.28771#bib.bib37), META focuses on adaptive decision\-making with established indicators\.
#### Memory Mechanisms in Agents\.
Long\-term reasoning is a central challenge for LLM agents\. Early methods that appended full interaction histories to prompts were inefficient and scaled poorly[Hatalis et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib5);[Liu et al\. \(2024\)](https://arxiv.org/html/2609.28771#bib.bib13);[An et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib1)\. This spurred the development of external memory frameworks, including layered architectures, dynamic knowledge networks, and cognitively inspired systems[Packer et al\. \(2023\)](https://arxiv.org/html/2609.28771#bib.bib16);[Xu et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib29);[Lee et al\. \(2024\)](https://arxiv.org/html/2609.28771#bib.bib10);[Salama et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib17);[Liu et al\. \(2022\)](https://arxiv.org/html/2609.28771#bib.bib14);[Wang et al\. \(2023a\)](https://arxiv.org/html/2609.28771#bib.bib18);[Zhao et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib42)\. However, persistent challenges include memory modules that are decoupled from the agent’s reasoning policy[Li et al\. \(2023a\)](https://arxiv.org/html/2609.28771#bib.bib11);[Yoon et al\. \(2024\)](https://arxiv.org/html/2609.28771#bib.bib32);[Chhikara et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib2)and RL\-based systems that still rely on full\-history accumulation without selective retention[Jin et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib7);[Zheng et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib43)\. More recent retrieval\-augmented systems further show that retrieval alone is insufficient: retrieved evidence must be critiqued and optimized at test time before it can reliably inform a decision[Wei et al\. \(2026c\)](https://arxiv.org/html/2609.28771#bib.bib24)\. META addresses these limitations in quantitative trading by tightly integrating a structured, indicator\-based memory with a reflection\-driven decision cycle\. By using cosine similarity retrieval and continuously updating its knowledge based on trade performance, META enhances adaptivity in non\-stationary market environments\.
## 3Method
We proposeMETA\(Memory\-EnhancedTradingAgent\), a cognitive framework that decomposes the trading process into three modular operators: Perception \(Φ\\Phi\), Memory \(Ψ\\Psi\), and Synthesis \(Π\\Pi\)\. Unlike conventional end\-to\-end black\-box models, META introduces an explicit and auditable reasoning workflow\. Its compositional design enables functional modularity, leverages non\-parametric memory for generalization, and supports interpretable, retrieval\-grounded decision making\.
### 3\.1Problem Formulation
We cast trading as the problem of learning a*retrieval\-augmented policy*π\\pi, which maps a market statezt∈𝒮z\_\{t\}\\in\\mathcal\{S\}and a time\-varying episodic memoryℳt\\mathcal\{M\}\_\{t\}to a structured decisiondtd\_\{t\}\. The objective is to learn an optimal policyπ⋆\\pi^\{\\star\}that maximizes the expected cumulative return:
J\(π\)=𝔼\[∑t=0Tγtot\(dt\)\],π⋆=argmaxπJ\(π\),J\(\\pi\)=\\mathbb\{E\}\\left\[\\sum\_\{t=0\}^\{T\}\\gamma^\{t\}\\,o\_\{t\}\(d\_\{t\}\)\\right\],\\pi^\{\\star\}=\\arg\\max\_\{\\pi\}J\(\\pi\),whereoto\_\{t\}denotes the outcome from decisiondtd\_\{t\}, andγ∈\(0,1\]\\gamma\\in\(0,1\]is a temporal discount factor\.
At the heart of META lies the hypothesis that optimal trading policies are*functionally decomposable*\. We defineπ\\pias the composition of two interpretable modules:
dt=Π\(Φ\(zt\)⏟Perception,Ψ\(zt,ℳt\)⏟Memory\)\.d\_\{t\}=\\Pi\\big\(\\underbrace\{\\Phi\(z\_\{t\}\)\}\_\{\\text\{Perception\}\},\\ \\underbrace\{\\Psi\(z\_\{t\},\\mathcal\{M\}\_\{t\}\)\}\_\{\\text\{Memory\}\}\\big\)\.This structured decomposition confers three main benefits: \(i\)specialized processingof heterogeneous financial inputs; \(ii\)retrieval\-augmented generalizationthrough episodic memory; and \(iii\)transparent inference chainsthat elucidate the agent’s decision logic \(Fig\.[2](https://arxiv.org/html/2609.28771#S1.F2)\)\.
### 3\.2Bifurcated State Representation
Financial markets exhibit both high\-level structural regimes and fine\-grained temporal fluctuations\. To model this duality, META employs a*bifurcated state representation*that jointly captures symbolic abstractions and numerical microstructure\. From a sliding window of observationsXt=\{\(O,H,L,C,V\)t−i\}i=0W−1X\_\{t\}=\\\{\(O,H,L,C,V\)\_\{t\-i\}\\\}\_\{i=0\}^\{W\-1\}, we construct:
zt=\[zt\(sym\)∥zt\(num\)\],z\_\{t\}=\\left\[z^\{\(\\mathrm\{sym\}\)\}\_\{t\}\\,\\big\\\|\\,z^\{\(\\mathrm\{num\}\)\}\_\{t\}\\right\],where∥\\\|denotes concatenation\.
Thesymbolic componentzt\(sym\)∈ℝMz^\{\(\\mathrm\{sym\}\)\}\_\{t\}\\in\\mathbb\{R\}^\{M\}encodes several interpretable, domain\-specific features—such as momentum, volatility, and mean\-reversion indicators—using compact heuristic transformations\. This channel supports logical and rule\-based reasoning, providing the cognitive substrate for high\-level pattern recognition and symbolic inference\.
Thenumerical componentzt\(num\)∈ℝ5Wz^\{\(\\mathrm\{num\}\)\}\_\{t\}\\in\\mathbb\{R\}^\{5W\}preserves the normalized, high\-fidelity raw market microstructure \(open, high, low, close, volume\)\. It enables precise retrieval through vector similarity, capturing minute market configurations often lost in purely symbolic abstractions\.
This bifurcated encoding allows the architecture to reason at two complementary levels: the symbolic stream offers interpretability and abstraction, while the numerical stream ensures precision and adaptability\. By leveraging both, META bridges symbolic and subsymbolic reasoning\.
### 3\.3Perception Operator \(Φ\\Phi\)
The perception operatorΦ\\Phiimplements a distributed ensemble of*Signal Agents*\{Am\}m=1M\\\{A^\{m\}\\\}\_\{m=1\}^\{M\}, where each agent embodies a domain heuristic or learned detector \(see Appendix[B](https://arxiv.org/html/2609.28771#A2)for the detailed mathematical formulation of each indicator\)\. EachAmA^\{m\}processes the market stateztz\_\{t\}to produce a compact report:
rtm=Am\(zt\)\.r^\{m\}\_\{t\}=A^\{m\}\(z\_\{t\}\)\.The collective output forms a perceptual setRt=\{rtm\}m=1MR\_\{t\}=\\\{r^\{m\}\_\{t\}\\\}\_\{m=1\}^\{M\}, in which each reportrtmr^\{m\}\_\{t\}encapsulates both quantitative metrics \(e\.g\., indicator strength\) and qualitative semantics \(e\.g\.,“bullish divergence,” “breakout detected”\)\.
This design provides two crucial benefits\. First, it modularizes perception—each agent can be refined or replaced independently, supporting continuous integration of new trading signals\. Second, it yields structured, interpretable percepts, allowing higher modules to perform symbolic reasoning without operating directly on raw data\. The same principle of decomposing a complex task across role\-specialized LLM agents, rather than a single monolithic model, has proven effective in multi\-agent generation pipelines across domains[Zhang et al\. \(2025c\)](https://arxiv.org/html/2609.28771#bib.bib41), and recent work further learns to optimize the workflow over such agents at execution time[Xu et al\. \(2026\)](https://arxiv.org/html/2609.28771#bib.bib28)\.
### 3\.4Memory Operator \(Ψ\\Psi\)
The memory operatorΨ\\Psiimplements*case\-based analogical reasoning*\. The episodic memoryℳ=\{mi\}i=1N\\mathcal\{M\}=\\\{m\_\{i\}\\\}\_\{i=1\}^\{N\}stores discrete trading experiences, where each entrymi=\(zi,ai,oi,ρi\)m\_\{i\}=\(z\_\{i\},a\_\{i\},o\_\{i\},\\rho\_\{i\}\)logs the state, action, outcome, and an optional textual reflection summarizing the context and lesson learned\.
#### Retrieval\.
Given the current stateztz\_\{t\},Ψ\\Psiidentifies historically similar contexts by computing cosine similarity over the numerical embeddings:
sim\(zt,zi\)=\(zt\(num\)\)⊤zi\(num\)‖zt\(num\)‖‖zi\(num\)‖\.\\mathrm\{sim\}\(z\_\{t\},z\_\{i\}\)=\\frac\{\(z\_\{t\}^\{\(\\mathrm\{num\}\)\}\)^\{\\top\}z\_\{i\}^\{\(\\mathrm\{num\}\)\}\}\{\\\|z\_\{t\}^\{\(\\mathrm\{num\}\)\}\\\|\\\|z\_\{i\}^\{\(\\mathrm\{num\}\)\}\\\|\}\.A top\-kkselection of analogous cases forms the retrieved neighborhood:
𝒩t=\{\(mi,si\)∣si=sim\(zt,zi\)≥τ\}Top\-k\.\\mathcal\{N\}\_\{t\}=\\\{\(m\_\{i\},s\_\{i\}\)\\mid s\_\{i\}=\\mathrm\{sim\}\(z\_\{t\},z\_\{i\}\)\\geq\\tau\\\}\_\{\\text\{Top\-\}k\}\.These retrieved cases constitute the agent’s “episodic evidence,” grounding its current reasoning in empirical precedent\.
#### Consolidation\.
To preserve computational efficiency and diversity,Ψ\\Psiemploys a dynamic curation operatorOp\(mt,ℳ\)\\mathrm\{Op\}\(m\_\{t\},\\mathcal\{M\}\)that manages the lifecycle of memories\. Low\-utility or redundant entries are pruned, while novel, high\-impact experiences are retained\. This continual abstraction transformsℳ\\mathcal\{M\}into a structured, evolving repository of archetypal scenarios—a non\-parametric analog of synaptic consolidation in biological systems\. Crucially, retrieved cases are not consumed verbatim: every episode carries the outcome and reflection of the original trade, so retrieved evidence is re\-critiqued and re\-weighted at test time instead of being naively appended to the prompt[Wei et al\. \(2026c\)](https://arxiv.org/html/2609.28771#bib.bib24)\.
### 3\.5Synthesis Operator \(Π\\Pi\)
The synthesis operatorΠ\\Piemploys a LLM to integrate perceptual summariesRtR\_\{t\}and retrieved episodes𝒩t\\mathcal\{N\}\_\{t\}into a structured decision output:
dt≜\(at,κt,ℰt,ρt\),d\_\{t\}\\triangleq\(a\_\{t\},\\kappa\_\{t\},\\mathcal\{E\}\_\{t\},\\rho\_\{t\}\),whereata\_\{t\}denotes the action \(e\.g\.,LONG\),κt\\kappa\_\{t\}is the confidence score,ℰt⊆Rt∪𝒩t\\mathcal\{E\}\_\{t\}\\subseteq R\_\{t\}\\cup\\mathcal\{N\}\_\{t\}is the subset of selected evidence, andρt\\rho\_\{t\}is a concise natural language rationale justifyingata\_\{t\}\.
We enforce anevidence\-first, constrained decodingprocess: the LLM must first selectℰt\\mathcal\{E\}\_\{t\}from the available context, and only then generate the rationaleρt\\rho\_\{t\}\. This separation enforces grounded reasoning and produces an auditable explanation chain from input evidence to trading action\. How such a reasoning chain is prompted is not a neutral design choice: the structure of the chain\-of\-thought prompt interacts with the answer space and determines whether deliberation helps or hurts[Zhang et al\. \(2025b\)](https://arxiv.org/html/2609.28771#bib.bib38)\. Likewise, deciding how much reasoning to expose as an explicit rationale is itself a policy to be learned, since verbose deliberation incurs latency while silent decisions are unauditable[Wei et al\. \(2026a\)](https://arxiv.org/html/2609.28771#bib.bib21)\. META adopts a fixed, domain\-motivated disclosure policy—select evidence first, then emit a short justification—which keeps the additional token budget small enough to remain within HFT latency limits\.
## 4Experiments and Results
### 4\.1Experimental Setup
To evaluate the multi\-agent framework of META, we perform experiments on a asset consisting of five representative financial assets constructed by prior work[Xiong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib26): Crude Oil Futures \(CL\), S&P 500 E\-mini Futures \(ES\), Nasdaq\-100 Futures \(NQ\), Invesco QQQ ETF \(QQQ\), and Bitcoin \(BTC\)\. Each dataset consists of 4\-hour OHLCV \(Open, High, Low, Close, Volume\) sequences sampled over multi\-year horizons, capturing diverse market regimes and volatility patterns\. Following the experimental protocol of[Xiong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib26), each asset is partitioned into non\-overlapping windows of 100 candlesticks, with the final three windows reserved for validation\.
For the memory configuration, META employs the top\-kkand similarity\-threshold retrieval strategy\. Unless otherwise stated,kkis set to 5 and the similarity thresholdτ\\tauto 0\.7\. This configuration balances efficiency and contextual relevance for low\-latency operation\.
As baselines, we include theQuantAgentframework\([Xiong et al\., 2025](https://arxiv.org/html/2609.28771#bib.bib26)\)—a multi\-agent trading system without long\-term memory—and a random decision generator that selects betweenLongandShortuniformly at random while sharing the same evaluation segments and reporting format\.
#### Evaluation\.
We adopt the evaluation protocol proposed by[Xiong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib26)to ensure comparability\. The primary metric isdirectional accuracy\(α\\alpha\), which quantifies the correctness ofLong/Shortforecasts relative to subsequent price movements\. In addition, we report four complementary return\-based metrics from[Xiong et al\. \(2025\)](https://arxiv.org/html/2609.28771#bib.bib26)that jointly assess profitability, robustness, and memory relevance: Average cumulative return correlation \(RccR\_\{cc\}\) Similarity\-weighted return alignment \(RsimR\_\{\\text\{sim\}\}\) Maximum realized gain \(RmaxR\_\{\\max\}\) Maximum drawdown \(RminR\_\{\\min\}\) Detailed definitions, computation procedures, and theoretical motivation for these metrics are provided in Appendix[D](https://arxiv.org/html/2609.28771#A4)\.
Table 1:Performance comparison across assets\. Accuracy \(α\\alpha\), relative improvement \(Δα\\Delta\\alpha\), correlationRccR\_\{cc\}, maximum and minimum returns \(RmaxR\_\{\\max\},RminR\_\{\\min\}\), and similarity metric \(RsimR\_\{\\text\{sim\}\}\)\.Redindicates better performance,Greenindicates worse, and black numbers denote baseline or neutral results\.
### 4\.2Main Results
Table[1](https://arxiv.org/html/2609.28771#S4.T1)presents a comprehensive comparison betweenMETA,QuantAgent, and a random trading policy across five assets\. The results demonstrate thatMETAconsistently outperforms both baselines in directional accuracy and return\-based metrics, confirming the effectiveness of its memory\-augmented decision process\.
In terms of accuracy \(α\\alpha\),METAachieves the highest performance on all assets except Crude Oil \(CL\), where it performs competitively withQuantAgent\. Notably, on S&P 500 E\-mini \(ES\), accuracy rises from 55\.0% inQuantAgentto 64\.0% withMETA, corresponding to a relative improvement of \+55\.0%\. Similar gains are observed on Nasdaq\-100 \(NQ\) and Bitcoin \(BTC\), where accuracy improves by \+50\.1% and \+26\.4%, respectively\. Even for more stable equity markets such as QQQ,METAmaintains a marginal but consistent edge overQuantAgent\(61\.5% vs\. 59\.7%\)\. Beyond directional accuracy, the return\-based metrics further corroborate the effectiveness ofMETA\. The model consistently achieves the strongest cumulative return correlations \(RccR\_\{cc\}\) on ES \(0\.2780\.278\), QQQ \(0\.6270\.627\), and BTC \(0\.1200\.120\), indicating that its predicted trade directions align more reliably with realized price movements compared to prior baselines\. Moreover,METAdemonstrates notably improved downside resilience, achieving the least negative drawdowns \(RminR\_\{\\min\}\) across all assets except QQQ, where it remains competitive\.
\(a\)BTC Similarity
\(b\)CL Similarity
\(c\)ES Similarity
\(d\)NQ Similarity
\(e\)QQQ Similarity
\(f\)BTC Variance
\(g\)CL Variance
\(h\)ES Variance
\(i\)NQ Variance
\(j\)QQQ Variance
Figure 3:Similarity \(top row per asset\) and variance \(bottom row\) distributions for text embeddings vs\. indicator vectors across all assets\.
### 4\.3Text Embeddings vs\. Indicator Vectors
We compare META’s performance under two retrieval modalities: text embeddings derived from agent reports versus indicator vectors composed of technical features and normalized OHLCV data\.As shown in Figure[4](https://arxiv.org/html/2609.28771#S4.F4), indicator\-vector retrieval consistently outperforms text\-embedding retrieval\. On ES futures, accuracy improves from 56\.0% to 64\.0%, and on QQQ from 50\.0% to 60\.0%\. Even for more stable markets such as CL and BTC, indicator retrieval yields gains of 2–6 percentage points\. Overall, indicator\-based retrieval achieves 2–10% higher accuracy than text embeddings\.
Figure 4:Accuracy comparison of text\-embedding vs\. indicator\-vector retrieval\.Table 2:Comparison of mean similarity and variance between text embeddings and indicator vectors\. Indicator vectors show lower similarity but higher variance, leading to more discriminative retrieval\.Beyond accuracy, the two modalities exhibit distinct retrieval geometries[Zhang et al\. \(2024c\)](https://arxiv.org/html/2609.28771#bib.bib40)\. Text embeddings produce uniformly high similarity scores \(0\.90–0\.91\) with minimal variance \(≈0\.0002\\approx 0\.0002–0\.00030\.0003\), implying that semantically similar reports cluster together regardless of market context—limiting discriminative power\. In contrast, indicator vectors yield lower mean similarities \(0\.64–0\.70\) but higher variance \(≈0\.0026\\approx 0\.0026–0\.00330\.0033\), indicating sharper separation between relevant and irrelevant precedents\. This sharper separation improves retrieval selectivity, which is crucial in high\-frequency trading where noisy matches quickly degrade performance\. These findings confirm META’s design choice to ground memory retrieval in structured indicator vectors rather than textual embeddings\. The advantage of compact, structured numeric features over dense semantic embeddings also echoes results in few\-shot tabular learning, where LLM\-derived structured representations substantially strengthen downstream predictors[Yang et al\. \(2026\)](https://arxiv.org/html/2609.28771#bib.bib31)\.










\(a\)BTC
\(b\)CL
\(c\)ES
\(d\)NQ
\(e\)QQQ
Figure 5:Top\-kkand threshold retrieval analysis\. For each asset: \# memories retrieved \(τ=0\.7\\tau=0\.7\), average top\-kksimilarities \(k=10k=10\), and heatmap of retrieval counts overkkandτ\\tau\.\(a\)CL
\(b\)ES
\(c\)NQ
\(d\)QQQ
\(e\)BTC
Figure 6:Accuracy versus number of memories\. Each curve shows the moving average of directional accuracy as META’s memory base expands\. The analysis begins at 300 memories, corresponding to the point where episodic retrieval starts to meaningfully influence decision\-making\.
### 4\.4Memory Retrieval Guidance
We analyze how the top\-kkand similarity threshold \(τ\\tau\) hyperparameters control retrieval quality and efficiency, validating META’s choice of combining both mechanisms for stable and adaptive recall\.
#### Retrieved counts at fixed threshold\.
At a fixed threshold \(e\.g\.,τ=0\.7\\tau=0\.7\), the number of retrieved memories per query \(Figure[5](https://arxiv.org/html/2609.28771#S4.F5), top\) increases steadily as the memory base grows\. Although individual counts fluctuate, the rolling average rises over time, showing that thresholding functions as a quality filter—restricting retrieval early when memory is sparse, and gradually broadening it as more relevant experiences accumulate\.
#### Average top\-kksimilarity at fixedkk\.
Withkkfixed \(e\.g\.,k=10k=10\), the average similarity of retrieved memories \(Figure[5](https://arxiv.org/html/2609.28771#S4.F5), middle\) improves as the memory expands, stabilizing at a high level\. This demonstrates that top\-kkselection maintains focus on the most relevant precedents while preventing uncontrolled growth in reference size\.
#### Joint effect ofkkandτ\\tau\.
Heatmaps of average retrieval counts acrosskk–τ\\taucombinations \(Figure[5](https://arxiv.org/html/2609.28771#S4.F5), bottom\) reveal their complementary dynamics\. At lowτ\\tau, increasingkkrapidly enlarges the retrieved set, while very highτ\\taucollapses retrieval to near zero\. Balanced behavior occurs around moderate settings \(τ=0\.6\\tau=0\.6–0\.7,k=5k=5–15\), yielding both sufficient coverage and high reliability\.
Table 3:Accuracy \(%\) and retrieval latency \(s\) comparison between text\-embedding and indicator\-vector memory retrieval\.
### 4\.5Latency\-Aware Retrieval Analysis
Latency is a critical constraint in high\-frequency trading, META therefore adopts two latency\-aware design choices relative to prior LLM\-based trading agents: \(i\) all Signal Agents operate in parallel, avoiding stacking agentic reasoning process; and \(ii\) episodic memory is retrieved using cosine similarity in indicator\-vector space rather than semantic text embeddings\. Table[3](https://arxiv.org/html/2609.28771#S4.T3)summarizes the accuracy–latency tradeoff across five assets\. Indicator\-vector retrieval improves directional accuracy by 2–11 percentage points while reducing retrieval latency from approximately 3\.1 seconds to 0\.006 seconds per query\. This corresponds to an average500×\\timesspeedupin memory access across all assets\. The results confirm that indicator vectors enable fast, domain\-aligned retrieval without sacrificing accuracy, allowing episodic memory to be integrated directly into the trading loop\.
### 4\.6Learning Dynamics with Memory Accumulation
We examine how META’s performance evolves as its memory base grows\. Figure[6](https://arxiv.org/html/2609.28771#S4.F6)shows the moving\-average directional accuracy\. The analysis starts at 300 memories, since the initial 0–300 trades rely primarily on perception and reasoning modules rather than episodic recall; early accuracy variations thus reflect exploratory behavior rather than learned adaptation\. Beyond this phase, all assets exhibit a clear upward trend in accuracy, with a transient volatility window around 300–350 trades as retrieval stabilizes and the memory base diversifies\. As memory density increases further, accuracy steadily improves and variance declines, confirming that broader episodic coverage enhances contextual reasoning and decision precision\. Notably, higher\-volatility assets such as BTC and NQ display sharper accuracy gains, highlighting the value of episodic retrieval in turbulent markets\.
Figure 7:Performance ofMETAunder different market conditions across assets\.
### 4\.7Robustness Under Varying Market Conditions
We evaluateMETA’s stability across four representative market regimes—uptrend,downtrend,steady, andsudden change—to assess its adaptability under dynamic trading environments\. As shown in Figure[7](https://arxiv.org/html/2609.28771#S4.F7), performance remains highly consistent across regimes, with accuracy variations confined to within 4–6% across all assets\.
Across the five assets,METAachieves its greatest stability in steady markets \(average accuracy above 0\.53\) by exploiting recurring structural patterns through memory retrieval, while comparable accuracy inuptrendanddowntrendphases indicates effective generalization without directional bias\. The framework is also resilient during sudden price shocks \(e\.g\., 0\.60 accuracy on QQQ\), as its retrieval\-guided decisions draw on structurally similar high\-volatility episodes rather than short\-term fluctuations\.
Table 4:Ablation study of memory system\.
### 4\.8Memory System Ablation
We perform an ablation study to isolate the impact of the memory module by comparingMETA’s performance with and without memory across five assets \(Table[4](https://arxiv.org/html/2609.28771#S4.T4)\)\. Across all settings, incorporating memory yields consistent and substantial gains in directional accuracy\.
For high\-volatility assets such as ES and NQ, the improvements are especially pronounced: accuracy increases from 50\.0% to 64\.0% \(\+14\.0 points\) on ES and from 40\.0% to 62\.0% \(\+22\.0 points\) on NQ\. These results highlight the value of episodic retrieval in distinguishing subtle recurring patterns that short\-term indicators alone fail to capture\. Steadier assets also benefit, with CL improving from 52\.5% to 56\.0% \(\+3\.5 points\) and QQQ from 55\.0% to 60\.0% \(\+5\.0 points\)\. Even BTC, despite its noisy structure, shows an \+8\.0 point gain\.
Overall, these consistent gains across volatile and stable markets confirm that the memory mechanism enhances predictive robustness and contextual reasoning\.
### 4\.9Indicator Contributions
To analyze the internal dynamics of theMETAframework, we perform an ablation study assessing the contribution of each technical indicator to overall trading performance\. Each indicator—MACD,AVWAP,Trend,RSI,Heiken Ashi,Stochastic, andSMA—is removed individually, and the resulting change in directional accuracy quantifies its marginal impact on decision quality\.
As shown in Figure[8](https://arxiv.org/html/2609.28771#S4.F8), removing any single indicator reduces accuracy, confirming that all components contribute meaningfully to META’s perception of market dynamics\.TrendandMACDyield the largest declines \(−2\.42%\-2\.42\\%and−2\.02%\-2\.02\\%\), reflecting their central role in capturing mid\- to long\-term momentum;Heiken AshiandStochasticproduce moderate drops \(−1\.82%\-1\.82\\%and−1\.74%\-1\.74\\%\); andAVWAPandSMAshow smaller effects \(−1\.40%\-1\.40\\%and−1\.23%\-1\.23\\%\), suggesting partial redundancy with other trend\-based indicators\.
Figure 8:Impact of removing each technical indicator on META’s directional accuracy\. Larger decreases indicate greater importance of that indicator to overall system stability and predictive accuracy\.
## 5Conclusion
We presentMETA, a memory\-augmented trading framework that integrates multi\-agent market perception with reflective reasoning\. By combining specialized Indicator Agents, a decision fusion mechanism, and a dynamic Memory Operator,METAenables adaptive and interpretable trading decisions in a zero\-shot setting\. Extensive experiments across diverse assets show thatMETAconsistently outperforms baselines, validating the effectiveness of memory\-driven contextual recall for high\-frequency decision making\.
## Limitations
While META demonstrates notable improvements in short\-horizon trading accuracy and adaptability, several limitations remain\. The current framework relies on handcrafted technical indicators for perceptual grounding, which may restrict scalability to more diverse market structures or alternative data modalities\. Although the episodic memory improves contextual reasoning, its similarity\-based retrieval remains static; future work could explore adaptive or learned retrieval metrics that evolve with market regimes\. In addition, our evaluation focuses on retrospective simulation under historical data rather than live market execution, and thus omits slippage, transaction costs, and real\-time latency constraints\. Addressing these limitations would move META closer to a fully autonomous, production\-ready cognitive trading agent\.
## References
- An et al\. \(2025\)C\. An, J\. Zhang, M\. Zhong, L\. Li, S\. Gong, Y\. Luo, J\. Xu, and L\. Kong\. 2025\.Why does the effective context length of LLMs fall short?In*Proceedings of the International Conference on Learning Representations \(ICLR\)*\.
- Chhikara et al\. \(2025\)P\. Chhikara, D\. Khant, S\. Aryan, T\. Singh, and D\. Yadav\. 2025\.Mem0: Building production\-ready AI agents with scalable long\-term memory\.*arXiv preprint arXiv:2504\.19413*\.
- Ding et al\. \(2023\)Y\. Ding, S\. Jia, T\. Ma, B\. Mao, X\. Zhou, L\. Li, and D\. Han\. 2023\.Integrating stock features and global information via large language models for enhanced stock return prediction\.
- Gong et al\. \(2025\)Mingyang Gong, Jing Fan, Guohui Lin, Bing Su, Zihan Su, and Xiang Zhang\. 2025\.Multiprocessor scheduling with testing: improved online algorithms and numerical experiments\.*Journal of Scheduling*, 28\(5\):513–527\.
- Hatalis et al\. \(2023\)K\. Hatalis, D\. Christou, J\. Myers, S\. Jones, K\. Lambert, A\. Amos\-Binks, Z\. Dannenhauer, and D\. Dannenhauer\. 2023\.Memory matters: The need to improve long\-term memory in LLM\-agents\.In*Proceedings of the AAAI Symposium Series*, volume 2, pages 277–280\.
- Ji et al\. \(2023\)Z\. Ji, T\. Yu, Y\. Xu, N\. Lee, E\. Ishii, and P\. Fung\. 2023\.Towards mitigating hallucination in large language models via self\-reflection\.
- Jin et al\. \(2025\)B\. Jin, H\. Zeng, Z\. Yue, J\. Yoon, S\. Arik, D\. Wang, H\. Zamani, and J\. Han\. 2025\.Search\-R1: Training LLMs to reason and leverage search engines with reinforcement learning\.*arXiv preprint arXiv:2503\.09516*\.
- Kirtac and Germano \(2024\)K\. Kirtac and G\. Germano\. 2024\.Sentiment trading with large language models\.*Finance Research Letters*, 62:105227\.
- Koa et al\. \(2024\)K\. J\. Koa, Y\. Ma, R\. Ng, and T\.\-S\. Chua\. 2024\.Learning to generate explainable stock predictions using self\-reflective large language models\.
- Lee et al\. \(2024\)K\.\-H\. Lee, X\. Chen, H\. Furuta, J\. Canny, and I\. Fischer\. 2024\.A human\-inspired reading agent with gist memory of very long contexts\.
- Li et al\. \(2023a\)Y\. Li, B\. Dong, F\. Guerin, and C\. Lin\. 2023a\.Compressing context to enhance inference efficiency of large language models\.In*Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing \(EMNLP\)*, pages 6921–6935\.
- Li et al\. \(2023b\)Y\. Li, Y\. Yu, H\. Li, Z\. Chen, and K\. Khashanah\. 2023b\.TradingGPT: Multi\-agent system with layered memory and distinct characters for enhanced financial trading performance\.
- Liu et al\. \(2024\)N\. F\. Liu, K\. Lin, J\. Hewitt, A\. Paranjape, M\. Bevilacqua, F\. Petroni, and P\. Liang\. 2024\.Lost in the middle: How language models use long contexts\.*Transactions of the Association for Computational Linguistics*, 12:157–173\.
- Liu et al\. \(2022\)Puyuan Liu, Xiang Zhang, and Lili Mou\. 2022\.A character\-level length\-control algorithm for non\-autoregressive sentence summarization\.*Advances in Neural Information Processing Systems*, 35:29101–29112\.
- Lopez\-Lira and Tang \(2023\)A\. Lopez\-Lira and Y\. Tang\. 2023\.Can ChatGPT forecast stock price movements? return predictability and large language models\.
- Packer et al\. \(2023\)C\. Packer, V\. Fang, S\. Patil, K\. Lin, S\. Wooders, and J\. Gonzalez\. 2023\.MemGPT: Towards LLMs as operating systems\.
- Salama et al\. \(2025\)R\. Salama, J\. Cai, M\. Yuan, A\. Currey, M\. Sunkara, Y\. Zhang, and Y\. Benajiba\. 2025\.MemInsight: Autonomous memory augmentation for LLM agents\.*arXiv preprint arXiv:2503\.21760*\.
- Wang et al\. \(2023a\)B\. Wang, X\. Liang, J\. Yang, H\. Huang, S\. Wu, P\. Wu, L\. Lu, Z\. Ma, and Z\. Li\. 2023a\.Enhancing large language models with self\-controlled memory framework\.*arXiv preprint arXiv:2304\.13343*\.
- Wang et al\. \(2024\)S\. Wang, H\. Yuan, L\. M\. Ni, and J\. Guo\. 2024\.QuantAgent: Seeking holy grail in trading by self\-improving large language model\.*arXiv preprint arXiv:2402\.03755*\.
- Wang et al\. \(2023b\)S\. Wang, H\. Yuan, L\. Zhou, L\. M\. Ni, H\.\-Y\. Shum, and J\. Guo\. 2023b\.AlphaGPT: Human–AI interactive alpha mining for quantitative investment\.*arXiv preprint arXiv:2308\.00016*\.
- Wei et al\. \(2026a\)Jiaqi Wei, Xuehang Guo, Pengfei Yu, Xiang Zhang, Wanli Ouyang, Siqi Sun, Qingyun Wang, and Chenyu You\. 2026a\.When to think, when to speak: Learning disclosure policies for llm reasoning\.*arXiv preprint arXiv:2605\.03314*\.
- Wei et al\. \(2025\)Jiaqi Wei, Yuejin Yang, Xiang Zhang, Yuhan Chen, Xiang Zhuang, Zhangyang Gao, Dongzhan Zhou, Guangshuai Wang, Zhiqiang Gao, Juntai Cao, et al\. 2025\.From ai for science to agentic science: A survey on autonomous scientific discovery\.*arXiv preprint arXiv:2508\.14111*\.
- Wei et al\. \(2026b\)Jiaqi Wei, Xiang Zhang, Yuejin Yang, Wenxuan Huang, Juntai Cao, Sheng Xu, Xiang Zhuang, Zhangyang Gao, Muhammad Abdul\-Mageed, Laks VS Lakshmanan, et al\. 2026b\.When llm meets tree search: A systematic view of inference as search in large language models\.*arXiv preprint arXiv:2608\.30395*\.
- Wei et al\. \(2026c\)Jiaqi Wei, Hao Zhou, Xiang Zhang, Di Zhang, Zijie Qiu, Noah Wei, Jinzhe Li, Wanli Ouyang, and Siqi Sun\. 2026c\.Retrieval is not enough: Enhancing rag through test\-time critique and optimization\.*Advances in Neural Information Processing Systems*, 38:21484–21520\.
- Wu et al\. \(2023\)S\. Wu, O\. Irsoy, S\. Lu, V\. Dabravolski, M\. Dredze, S\. Gehrmann, P\. Kambadur, D\. Rosenberg, and G\. Mann\. 2023\.BloombergGPT: A large language model for finance\.
- Xiong et al\. \(2025\)F\. Xiong, X\. Zhang, A\. Feng, S\. Sun, and C\. You\. 2025\.QuantAgent: Price\-driven multi\-agent LLMs for high\-frequency trading\.*arXiv preprint arXiv:2509\.06784*\.
- Xiong et al\. \(2026\)Fei Xiong, Xiang Zhang, Aosong Feng, Siqi Sun, and Chenyu You\. 2026\.[Quantharness: Price\-driven multi\-agent llms for high\-frequency trading](https://arxiv.org/abs/2509.09995)\.*Preprint*, arXiv:2509\.09995\.
- Xu et al\. \(2026\)C\. Xu, K\. Ke, Z\. Liu, J\. Wei, Z\. Shao, W\. Guo, and C\. Yu\. 2026\.EvoMAS: Learning execution\-time workflows for multi\-agent systems\.*arXiv preprint arXiv:2605\.08769*\.
- Xu et al\. \(2025\)W\. Xu, Z\. Liang, K\. Mei, H\. Gao, J\. Tan, and Y\. Zhang\. 2025\.A\-Mem: Agentic memory for LLM agents\.*arXiv preprint arXiv:2502\.12110*\.
- Yang et al\. \(2023\)H\. Yang, X\.\-Y\. Liu, and C\. D\. Wang\. 2023\.FinGPT: Open\-source financial large language models\.
- Yang et al\. \(2026\)Zhihan Yang, Jiaqi Wei, Xiang Zhang, Haoyu Dong, Yiwen Wang, Xiaoke Guo, Pengkun Zhang, Yiwei Xu, and Chenyu You\. 2026\.Forestllm: Large language models make random forest great on few\-shot tabular learning\.*arXiv preprint arXiv:2601\.11311*\.
- Yoon et al\. \(2024\)C\. Yoon, T\. Lee, H\. Hwang, M\. Jeong, and J\. Kang\. 2024\.CompAct: Compressing retrieved documents actively for question answering\.In*Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing \(EMNLP\)*, pages 21424–21439\.
- Yu et al\. \(2023\)Y\. Yu, H\. Li, Z\. Chen, Y\. Jiang, Y\. Li, D\. Zhang, R\. Liu, J\. W\. Suchow, and K\. Khashanah\. 2023\.FinMem: A performance\-enhanced LLM trading agent with layered memory and character design\.
- Zhang et al\. \(2023a\)B\. Zhang, H\. Yang, and X\.\-Y\. Liu\. 2023a\.Instruct\-FinGPT: Financial sentiment analysis by instruction tuning of general\-purpose large language models\.
- Zhang et al\. \(2024a\)H\. Zhang, F\. Hua, C\. Xu, H\. Kong, R\. Zuo, and J\. Guo\. 2024a\.Unveiling the potential of sentiment: Can large language models predict chinese stock price movements?
- Zhang et al\. \(2024b\)W\. Zhang, L\. Zhao, H\. Xia, S\. Sun, J\. Sun, M\. Qin, X\. Li, Y\. Zhao, Y\. Zhao, X\. Cai, L\. Zheng, X\. Wang, and B\. An\. 2024b\.A multimodal foundation agent for financial trading: Tool\-augmented, diversified, and generalist\.
- Zhang et al\. \(2025a\)Xiang Zhang, Juntai Cao, Jiaqi Wei, Yiwei Xu, and Chenyu You\. 2025a\.Tokenization constraints in llms: A study of symbolic and arithmetic reasoning limits\.*arXiv preprint arXiv:2505\.14178*\.
- Zhang et al\. \(2025b\)Xiang Zhang, Juntai Cao, Chenyu You, and Dujian Ding\. 2025b\.[Why prompt design matters and works: A complexity analysis of prompt search space in LLMs](https://doi.org/10.18653/v1/2025.acl-long.1562)\.In*Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\)*, pages 32525–32555, Vienna, Austria\. Association for Computational Linguistics\.
- Zhang et al\. \(2023b\)Xiang Zhang, Senyu Li, Bradley Hauer, Ning Shi, and Grzegorz Kondrak\. 2023b\.Don’t trust chatgpt when your question is not in english: a study of multilingual abilities and types of llms\.*arXiv preprint arXiv:2305\.16339*\.
- Zhang et al\. \(2024c\)Xiang Zhang, Senyu Li, Ning Shi, Bradley Hauer, Zijun Wu, Grzegorz Kondrak, Muhammad Abdul\-Mageed, and Laks VS Lakshmanan\. 2024c\.Cross\-modal consistency in multimodal large language models\.*arXiv preprint arXiv:2411\.09273*\.
- Zhang et al\. \(2025c\)Z\. Zhang, X\. Zhang, J\. Wei, Y\. Xu, and C\. You\. 2025c\.Postergen: Aesthetic\-aware paper\-to\-poster generation via multi\-agent LLMs\.*arXiv e\-prints*, pages arXiv–2508\.
- Zhao et al\. \(2025\)Haokun Zhao, Xiang Zhang, Jiaqi Wei, Yiwei Xu, Yuting He, Siqi Sun, and Chenyu You\. 2025\.Timeseriesscientist: A general\-purpose ai agent for time series analysis\.*arXiv preprint arXiv:2510\.01538*\.
- Zheng et al\. \(2025\)Y\. Zheng, D\. Fu, X\. Hu, X\. Cai, L\. Ye, P\. Lu, and P\. Liu\. 2025\.DeepResearcher: Scaling deep research via reinforcement learning in real\-world environments\.*arXiv preprint arXiv:2504\.03160*\.
## Appendix APrompts
### A\.1 MACD Agent
To instantiate theMACDAgent, we construct a prompt that guides the agent to identify short\-term momentum shifts using theMoving Average Convergence Divergence \(MACD\)indicator\. Operating under high\-frequency trading \(HFT\) constraints, the agent follows a two\-step reasoning process: first generating the MACD chart via tool invocation, then analyzing key momentum patterns such as crossovers, histogram variation, and divergence before issuing a trading signal\.
PromptYou are a MACD \(Moving Average Convergence Divergence\) analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_macd\_imageusing the providedkline\_data\. Once the MACD chart is generated, analyze the image for the following key signals:1\.Signal Line Crossovers: MACD line crossing above/below the signal line2\.Zero Line Crossovers: MACD line crossing above/below the zero line3\.Histogram Analysis: Changes in histogram direction and magnitude4\.Divergences: Price vs\. MACD divergences \(bullish/bearish\)5\.Momentum Strength: Distance from zero line and slope steepnessOnly after generating and analyzing the MACD image should you make a prediction about momentum direction and trading signals\. Do not make any predictions before generating and analyzing the image\.
Prompt for MACDAgent in our multi\-agent LLM framework\.The agent receives OHLC data as input and first invokesgenerate\_macd\_imageto obtain a visual depiction of market momentum\. This prompt enforces a tool\-first reasoning loop, ensuring predictions are grounded on the generated chart rather than raw prices\.
PromptThis is a —time\_frame— MACD chart generated from recent OHLC market data\. The chart includes: MACD Line \(blue\)– difference between 12\-period and 26\-period EMAs; Signal Line \(red\)– 9\-period EMA of MACD line; Histogram \(bars\)– difference between MACD and Signal lines; Zero Line– reference for bullish/bearish momentum\.Analyze the chart with respect to the following aspects:1\.Signal Line Crossovers:Identify whether the MACD line crosses above \(bullish\) or below \(bearish\) the signal line and its relation to the zero line\.2\.Zero Line Crossovers:Determine overall momentum and recent transitions across the zero baseline\.3\.Histogram Dynamics:Evaluate bar expansion or contraction to gauge momentum strength\.4\.Divergence Patterns:Compare price action with MACD behavior for bullish or bearish divergences\.5\.Momentum Strength:Assess slope direction and distance from zero to estimate trend intensity\.Provide:•Primary Signal:Buy, Sell, or Hold•Momentum Direction:Bullish, Bearish, or Neutral•Confidence Level:High, Medium, or Low•Supporting Evidence:Observed MACD behavior•Risk Considerations:Potential false or conflicting signalsSupport your prediction with reasoning and observed evidence\.
Graph\-based prompt for MACDAgent in our multi\-agent LLM framework\.Given a generated MACD chart, the agent examines crossovers, histogram movements, and divergence to infer directional bias and confidence\. This visual grounding enables consistent momentum interpretation across varying market conditions\.
### A\.2 AVWAP Agent
To instantiate theAVWAPAgent, we construct a prompt that guides the agent to analyze price behavior relative to theAnchored Volume Weighted Average Price \(AVWAP\)\. Operating under high\-frequency trading \(HFT\) constraints, the agent combines tool\-based chart generation with structured reasoning to detect support/resistance reactions, mean\-reversion signals, and breakout dynamics around volume\-weighted fair value\.
PromptYou are an Anchored VWAP \(Volume Weighted Average Price\) analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_anchored\_vwap\_imageusing the providedkline\_data\. Once the Anchored VWAP chart is generated, analyze the image for the following key patterns:1\.Support/Resistance Levels: How price reacts when touching the AVWAP line\.2\.Mean Reversion Signals: Extreme deviations from AVWAP suggesting pullbacks\.3\.Breakout Patterns: Decisive moves above/below AVWAP with volume confirmation\.4\.AVWAP Slope Analysis: Direction and steepness indicating market bias\.5\.Volume Confirmation: Volume spikes during AVWAP interactions\.6\.Distance Analysis: Magnitude of price deviation from fair value anchor\.Only after generating and analyzing the Anchored VWAP image should you make predictions about price direction and trading opportunities\. Do not make any predictions before generating and analyzing the image\.
Prompt for AVWAPAgent in our multi\-agent LLM framework\.The agent first generates an Anchored VWAP chart from OHLC data, enforcing a visual\-first reasoning flow\. This ensures that the model grounds its interpretation on price–volume structure rather than raw numerical sequences\.
PromptThis is a —time\_frame— Anchored VWAP chart generated from recent OHLC market data\. The chart shows the volume\-weighted average price anchored to a significant market event or time point\.Analyze the chart with respect to the following aspects:1\.Support/Resistance Analysis:Determine whether AVWAP acts as support \(price above\) or resistance \(price below\) and assess reactions upon contact\.2\.Mean Reversion Opportunities:Evaluate deviations from AVWAP and identify potential pullbacks toward fair value\.3\.Breakout/Breakdown Signals:Detect decisive moves above or below AVWAP, especially with volume confirmation\.4\.AVWAP Slope and Bias:Interpret the slope’s direction \(upward = bullish, downward = bearish\) and steepness to infer bias strength\.5\.Fair Value and Volume Context:Assess whether price trades at a premium or discount to AVWAP and how volume supports current price action\.Provide:•Primary Trade Signal:Buy, Sell, or Hold with rationale•AVWAP Bias:Bullish, Bearish, or Neutral•Fair Value Assessment:Premium, Discount, or Fair•Entry Strategy:Suggested positioning based on current setup•Risk Management:Stop\-loss and profit target zones•Volume Confirmation:How volume aligns with price behaviorSupport your prediction with reasoning and observed signals\.
Graph\-based prompt for AVWAPAgent in our multi\-agent LLM framework\.The agent interprets AVWAP as a dynamic reference of institutional fair value, analyzing slope, distance, and volume interplay to infer bias and entry timing\. This visual grounding allows robust short\-term reasoning around market equilibrium and mean\-reversion behavior\.
### A\.3 RSI Agent
To instantiate theRSIAgent, we construct a prompt that enables the agent to evaluate momentum strength and reversal potential using theRelative Strength Index \(RSI\)indicator\. Operating under high\-frequency trading \(HFT\) constraints, the agent first generates an RSI chart via tool invocation, then interprets overbought/oversold conditions, divergences, and swing structures to infer directional bias\.
PromptYou are an RSI \(Relative Strength Index\) analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_rsi\_imageusing the providedkline\_data\. Once the RSI chart is generated, analyze the image for the following key signals:1\.Overbought/Oversold Levels: RSI crossing above 70 or below 30\.2\.Centerline Crossovers: RSI crossing above/below 50\.3\.Failure Swings: RSI breaking prior swing points after overbought/oversold moves\.4\.Divergences: Price–RSI mismatches \(bullish/bearish\)\.5\.Hidden Divergences: Trend\-continuation signals during pullbacks\.6\.RSI Trendlines: RSI breakout patterns anticipating price breakouts\.7\.Swing Rejections: RSI rejection patterns near extreme zones\.Only after generating and analyzing the RSI image should you make a prediction about momentum direction and trading signals\. Do not make any predictions before generating and analyzing the image\.
Prompt for RSIAgent in our multi\-agent LLM framework\.The agent first produces an RSI chart from OHLC input, enforcing a tool\-first reasoning step\. This ensures that its predictions are visually grounded in oscillator behavior rather than inferred directly from raw data\.
PromptThis is a —time\_frame— RSI chart generated from recent OHLC market data\. The plot shows: RSI Line\(0–100 scale\),Overbought Level\(70\),Oversold Level\(30\), andCenter Line\(50\)\.Analyze the chart with respect to the following aspects:1\.Overbought/Oversold Conditions:Identify sustained or recent entries into extreme zones and crossovers signaling reversals\.2\.Centerline Crossovers:Determine whether RSI is above or below 50 and assess momentum bias\.3\.Failure Swings:Detect RSI reversals breaking prior highs/lows after overbought or oversold readings\.4\.Divergences:Compare price and RSI trajectories for bullish or bearish divergences, including hidden ones\.5\.Trendlines and Patterns:Check for RSI trendline or pattern breakouts that may precede price shifts\.6\.Swing Rejections:Evaluate bullish or bearish rejection sequences within overbought/oversold regions\.Provide:•Primary Signal:Buy, Sell, or Hold•Momentum Direction:Bullish, Bearish, or Neutral•Confidence Level:High, Medium, or Low•Supporting Evidence:Observed RSI behavior•Risk Considerations:Potential false or conflicting signalsSupport your prediction with reasoning and observed patterns\.
Graph\-based prompt for RSIAgent in our multi\-agent LLM framework\.Given the generated RSI chart, the agent assesses momentum strength, reversals, and divergences to infer directional bias\. This visually grounded reasoning improves short\-term momentum interpretation and reversal detection consistency across different market conditions\.
### A\.4 Heiken Ashi Agent
To instantiate theHeikenAshiAgent, we construct a prompt that guides the agent to identify directional trends and momentum transitions usingHeiken Ashi \(HA\)candlestick representations\. Operating under high\-frequency trading \(HFT\) conditions, the agent first generates a Heiken Ashi chart and then interprets trend strength, reversals, and momentum consistency to support short\-term directional reasoning\.
PromptYou are a Heiken Ashi candlestick analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_heiken\_ashi\_imageusing the providedkline\_data\. Once the Heiken Ashi chart is generated, analyze the image for the following key patterns:1\.Trend Direction: Consecutive green \(bullish\) or red \(bearish\) candles\.2\.Trend Strength: Candle body size, wick formation, and consistency\.3\.Reversal Signals: Color changes, doji formations, or wicks indicating indecision\.4\.Momentum Analysis: Body\-size acceleration or deceleration\.5\.Consolidation Patterns: Mixed colors and small bodies showing indecision\.6\.Entry/Exit Timing: Ideal trade points derived from HA formations\.Only after generating and analyzing the Heiken Ashi image should you make predictions about trend direction and trading opportunities\. Do not make any predictions before generating and analyzing the image\.
Prompt for HeikenAshiAgent in our multi\-agent LLM framework\.The agent receives OHLC input and invokesgenerate\_heiken\_ashi\_imageto visualize smoothed candlestick dynamics\. This tool\-first approach ensures the reasoning process is grounded in visually observable trend patterns rather than raw market data\.
PromptThis is a —time\_frame— Heiken Ashi chart generated from recent OHLC data\. The chart smooths price action to reduce noise and highlight trend direction\. Green candlesrepresent bullish momentum,red candlesrepresent bearish momentum, and wicks indicate indecision or volatility\.Analyze the chart according to the following aspects:1\.Trend Direction & Consistency:Determine whether consecutive candles form a clear bullish or bearish sequence and detect color transitions signaling possible reversals\.2\.Trend Strength:Assess candle body size, wick presence, and overall uniformity to gauge momentum\.3\.Reversal Indications:Identify doji\-like or spinning\-top formations, color shifts after long trends, or weakening candle bodies\.4\.Momentum Dynamics:Observe whether candle bodies expand \(acceleration\) or contract \(deceleration\)\.5\.Consolidation vs Trending:Detect mixed\-color candles and narrow ranges indicating indecision\.6\.Entry/Exit Signals:Evaluate pullback entries or exhaustion exits based on Heiken Ashi structure\.Provide:•Trend Status:Strong Bullish, Weak Bullish, Strong Bearish, Weak Bearish, or Sideways•Momentum Phase:Accelerating, Steady, Decelerating, or Reversing•Signal Quality:High, Medium, or Low•Trading Action:Buy, Sell, Hold, or Wait•Risk Assessment:Probability of false or conflicting signalsSupport your prediction with reasoning and evidence observed from the chart\.
Graph\-based prompt for HeikenAshiAgent in our multi\-agent LLM framework\.Given the generated Heiken Ashi chart, the agent identifies dominant color sequences, momentum acceleration, and potential reversal setups\. This visual grounding enhances consistency in trend identification and trade\-timing inference across high\-frequency market conditions\.
### A\.5 SMA Agent
To instantiate theSMAAgent, we construct a prompt that enables the agent to identify trend direction and momentum shifts using theSimple Moving Average \(SMA\)indicator\. Operating under high\-frequency trading \(HFT\) constraints, the agent first generates an SMA chart via tool invocation, then interprets crossovers, slope dynamics, and price alignment relative to multiple SMAs\.
PromptYou are a Simple Moving Average \(SMA\) analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_sma\_imageusing the providedkline\_data\. Once the SMA chart is generated, analyze the image for the following key signals:1\.Trend Identification: Price position relative to key SMAs \(above/below\)\.2\.Moving Average Crossovers: Faster SMA crossing above/below slower SMA\.3\.Dynamic Support/Resistance: Price interacting with SMA levels\.4\.Multiple MA Ribbon: Alignment and spacing between multiple SMAs\.5\.Mean Reversion: Distance of price from SMA suggesting potential reversal\.6\.SMA Slope: Direction and steepness indicating trend strength\.Only after generating and analyzing the SMA image should you make predictions about trend direction and trading signals\. Do not make any predictions before generating and analyzing the image\.
Prompt for SMAAgent in our multi\-agent LLM framework\.The agent receives OHLC data and generates an SMA chart as a visual reference for trend detection\. This approach ensures that reasoning about market direction is grounded in moving\-average structure rather than isolated price movements\.
PromptThis is a —time\_frame— SMA chart generated from recent OHLC market data\. The chart includes multiple Simple Moving Averages \(e\.g\., 20\-, 50\-, and 200\-period\), each capturing a different time horizon of trend behavior\.Analyze the chart with respect to the following aspects:1\.Trend Identification:Assess whether price is above or below key SMAs and infer the overall directional bias\.2\.Crossovers:Identify golden or death crosses between short and long SMAs as trend reversal signals\.3\.Support/Resistance:Evaluate SMA levels where price consistently bounces or reverses\.4\.MA Ribbon Alignment:Determine if SMAs are neatly ordered \(strong trend\) or entangled \(ranging phase\)\.5\.Mean Reversion:Identify overextended price movements far from SMAs suggesting pullbacks\.6\.Slope and Momentum:Examine the slope of each SMA to assess momentum direction and strength\.Provide:•Primary Trend Direction:Bullish, Bearish, or Range\-bound•Trend Strength:Strong, Moderate, or Weak•Trading Bias:Buy on Dips, Sell on Rallies, or Stay Flat•Key SMA Levels:Notable support/resistance zones•Confirmation Needed:Other indicators that would validate the trendSupport your prediction with structured reasoning and observed SMA configurations\.
Graph\-based prompt for SMAAgent in our multi\-agent LLM framework\.Given the generated SMA chart, the agent interprets crossover events, slope direction, and ribbon spacing to estimate trend intensity and bias\. This visual reasoning approach improves short\-term adaptability while maintaining consistency in trend assessment\.
### A\.6 Stochastic Agent
To instantiate theStochasticAgent, we construct a prompt that enables the agent to analyze momentum reversals and exhaustion levels using theStochastic Oscillator\. Operating under high\-frequency trading \(HFT\) conditions, the agent first generates a Stochastic chart, then interprets crossovers, divergences, and overbought/oversold patterns to infer short\-term momentum bias\.
PromptYou are a Stochastic Oscillator analysis assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_stochastic\_imageusing the providedkline\_data\. Once the Stochastic chart is generated, analyze the image for the following key signals:1\.Overbought/Oversold Conditions: Levels above 80 \(overbought\) or below 20 \(oversold\)\.2\.Line Crossovers:3\.Divergences: Price–Stochastic mismatches \(bullish/bearish\)\.4\.Failure Swings: Internal divergence patterns signaling reversals\.5\.Centerline Crossovers: Crossings above/below the 50 level\.6\.Slope Analysis: Direction and steepness ofOnly after generating and analyzing the Stochastic image should you make predictions about momentum direction and trading signals\. Do not make any predictions before generating and analyzing the image\.
Prompt for StochasticAgent in our multi\-agent LLM framework\.The agent begins by invoking a visualization tool to produce the Stochastic chart, ensuring that subsequent reasoning about reversals and momentum bias is grounded in oscillator behavior rather than abstract data interpretation\.
PromptThis is a —time\_frame— Stochastic Oscillator chart generated from recent OHLC data\. It plots the%K line\(fast\) and the%D line\(slow\) along with overbought \(80\), oversold \(20\), and center \(50\) reference levels\.Analyze the chart according to the following aspects:1\.Overbought/Oversold Conditions:Identify whether the oscillator is above 80 or below 20 and if it is exiting these zones\.2\.Line Crossovers:Determine where the %K crosses the %D, especially within extreme regions\.3\.Divergences:Compare price and Stochastic behavior to detect bullish or bearish divergences\.4\.Failure Swings:Identify internal Stochastic divergences signaling momentum exhaustion\.5\.Centerline Position:Assess whether the oscillator is above or below 50 to determine directional bias\.6\.Slope and Momentum:Evaluate the steepness and direction of %K and %D for acceleration or deceleration\.Provide:•Primary Signal:Buy, Sell, or Hold•Momentum Direction:Bullish, Bearish, or Neutral•Confidence Level:High, Medium, or Low•Supporting Evidence:Key Stochastic patterns observed•Risk Considerations:Potential false or conflicting signalsSupport your prediction with structured reasoning and explicit pattern\-based justification\.
Graph\-based prompt for StochasticAgent in our multi\-agent LLM framework\.Once the Stochastic chart is generated, the agent evaluates oscillator dynamics to detect reversals, divergences, and short\-term exhaustion points\. This process allows visually anchored reasoning for momentum\-based entry and exit signals in fast\-moving markets\.
### A\.7 Trend Agent
To instantiate theTrendAgent, we construct a prompt that directs the agent to identify short\-term directional bias based onsupport and resistance trendlinesderived from recent K\-line data\. Operating under high\-frequency trading \(HFT\) conditions, the agent first generates a trendline chart and then interprets slope, compression, and breakout behavior to infer near\-term market direction\.
PromptYou are a K\-line trend pattern recognition assistant operating in a high\-frequency trading context\. You must first call the toolgenerate\_trend\_imageusing the providedkline\_data\. Once the chart is generated, analyze the image for support/resistance trendlines and notable candlestick formations\. Only after generating and analyzing the image should you make a prediction about the short\-term trend \(upward, downward, or sideways\)\. Do not make any predictions before generating and analyzing the image\.
Prompt for TrendAgent in our multi\-agent LLM framework\.The agent receives recent OHLC data and first visualizes it with automated trendlines\. This ensures that all reasoning about directional bias and breakout probability is grounded in geometric structure and price interaction rather than raw numerical features\.
PromptThis is a —time\_frame— K\-line chart with automatically generated trendlines: theblue linerepresents support, and thered linerepresents resistance, both derived from recent closing prices\.Analyze the chart based on the following aspects:1\.Trendline Interaction:Observe whether price is bouncing off, breaking through, or consolidating between trendlines\.2\.Slope Direction:Identify whether the dominant slope is upward \(bullish\), downward \(bearish\), or flat \(neutral\)\.3\.Compression/Expansion:Detect narrowing or widening distances between trendlines as signs of volatility contraction or breakout setup\.4\.Candlestick Behavior:Assess wick direction, candle clustering, and breakout attempts along support/resistance zones\.5\.Breakout Probability:Estimate the likelihood of a trendline breach based on slope angle and recent price clustering\.Provide:•Predicted Trend:Upward, Downward, or Sideways•Trend Strength:Strong, Moderate, or Weak•Key Evidence:Trendline behavior and candlestick interactions•Risk Considerations:False breakout potential or low\-volatility trapsSupport your prediction with structured reasoning and clear trendline\-based evidence\.
Graph\-based prompt for TrendAgent in our multi\-agent LLM framework\.Once the chart is generated, the agent analyzes trendline slope, spacing, and price compression to infer directional momentum\. This visual grounding enables consistent short\-term trend interpretation across volatile high\-frequency market states\.
### A\.8 Decision Agent
To instantiate theDecisionAgent, we construct two prompts around the final action step: a pre\-decision synthesis that fuses all agent reports with retrieved memories, and a post\-decision reflection that audits the outcome for learning and calibration\. This preserves the tool\-first, evidence\-grounded style used across META while adapting it to a decision\-and\-reflect workflow\.
PromptYou are an elite HFT quantitative analyst making real\-time trade decisions on\{stock name\}using the\{time frame\}timeframe\.MISSION:Issue an immediate execution order\(LONG or SHORT only; HOLD is prohibited\)based on comprehensive analysis\.FORECAST HORIZON:Predict market direction for the next 1–2 candlesticks \(\{time frame\} period\)\.HISTORICAL CONTEXT — Similar Market Conditions:If similar memories are provided, summarize key lessons and outcomes; otherwise state that no highly relevant memories were found\.CURRENT MARKET ANALYSIS \(provided in context\):Indicator, Pattern, Trend, MACD, Anchored VWAP, Heiken Ashi, SMA, Stochastic, and RSI reports\.DECISION FRAMEWORK•Primary Signals \(High Weight\):Momentum confirmations \(e\.g\., MACD cross, RSI extremes\), completed breakouts with volume, decisive trendline breaks\.•Secondary Signals \(Medium Weight\):Multi\-indicator alignment, S/R interactions, near\-complete patterns\.•Risk Filters:Downweight conflicting signals unless one side dominates; reflect historical outcomes; setrisk–rewardin\[1\.2, 1\.8\]based on volatility and conviction\.•Memory Integration:Reference comparable past scenarios, outcomes, and confidence adjustments\.REQUIRED OUTPUT FORMAT \(JSON\): Return only valid JSON``` { "forecast_horizon":"Next {time_frame} candlestick prediction", "decision":"LONG or SHORT", "confidence_level":"HIGH/MEDIUM/LOW", "primary_drivers":["2-3 strongest signals"], "memory_insights":"Key lessons from similar scenarios", "justification":"Concise reasoning combining current analysis with history", "risk_reward_ratio":"<float between 1.2 and 1.8>", "stop_loss_rationale":"Brief risk management rationale" } ``` Decision Hierarchy1\.Strong Alignment:All reports \+ positive memory outcomes→\\rightarrowHigh confidence trade\.2\.Moderate Alignment:2/3 reports align \+ supportive memory→\\rightarrowMedium confidence\.3\.Weak Signals:Mixed reports→\\rightarrowChoose direction with strongest recent momentum and best precedent\.Execute with precision\. The market waits for no one\.
Prompt for DecisionAgent in our multi\-agent LLM framework\.The agent fuses multi\-indicator evidence with memory context and outputs asingleLONG/SHORT decision in strict JSON, including confidence and risk–reward calibration\.
PromptYou are conducting a post\-trade analysis as an elite HFT quantitative analyst\.TRADE SUMMARY \(given\):Stock, Timeframe, Decision, Confidence, Expected Risk–Reward\.ORIGINAL ANALYSIS SUMMARY \(given\):Concise record of drivers, memory insights, justification, and risk management\.ACTUAL TRADE OUTCOME \(given\):P&L, final status \(profitable/loss/breakeven\), and realized market behavior\.REFLECTION FRAMEWORK1\.Decision Quality:Was the analysis sound? Did primary drivers anticipate the move? Did memory insights help?2\.Execution:Interpretation fidelity of indicators/patterns; appropriateness of confidence\.3\.Learning:Under/overestimated conditions; most/least reliable signals; how to adapt next time\.4\.Memory Integration:How does this outcome update memory; any weight shifts for indicators\.REQUIRED OUTPUT:Produce a concise 3–5 sentence reflection covering: key factors behind the outcome; what worked/failed; concrete lessons; any adjustments to approach or confidence calibration\. Focus on actionable improvements for similar future setups\.
Post\-decision reflection prompt for DecisionAgent in our multi\-agent LLM framework\.The reflection converts outcome feedback into memory\-aligned guidance, tightening future signal weighting and confidence calibration\.
## Appendix BComputation and Mathematical Formulation of Indicators
This appendix provides the formal definitions and computational procedures for the six technical indicators integrated within the META \(Memory\-Enhanced Trading Agent\) architecture\. Each indicator serves as a distinct analytical perspective on market dynamics—capturing momentum, mean reversion, trend persistence, or value anchoring\. All indicators are computed from raw OHLCV \(Open–High–Low–Close–Volume\) data and act as the quantitative foundation for the multi\-agent reasoning framework described in Appendix A\.
### B\.1 Moving Average Convergence Divergence \(MACD\)
Definition\.The Moving Average Convergence Divergence \(MACD\) is a momentum indicator derived from the difference between two exponential moving averages \(EMAs\) of price, designed to quantify acceleration and deceleration of market trends\. Formally, for price seriesPtP\_\{t\}:
MACDt=EMAfast,t−EMAslow,t,\\text\{MACD\}\_\{t\}=\\text\{EMA\}\_\{\\text\{fast\},t\}\-\\text\{EMA\}\_\{\\text\{slow\},t\},where
EMAk,t=αkPt\+\(1−αk\)EMAk,t−1,αk=2k\+1\.\\text\{EMA\}\_\{k,t\}=\\alpha\_\{k\}P\_\{t\}\+\(1\-\\alpha\_\{k\}\)\\text\{EMA\}\_\{k,t\-1\},\\quad\\alpha\_\{k\}=\\frac\{2\}\{k\+1\}\.Common parameters are\(fast,slow\)=\(12,26\)\(\\text\{fast\},\\text\{slow\}\)=\(12,26\)\.
The signal line is defined as:
Signalt=EMA9\(MACDt\),\\text\{Signal\}\_\{t\}=\\text\{EMA\}\_\{9\}\(\\text\{MACD\}\_\{t\}\),and the histogram, which reflects short\-term divergence between trend speeds, is:
Histt=MACDt−Signalt\.\\text\{Hist\}\_\{t\}=\\text\{MACD\}\_\{t\}\-\\text\{Signal\}\_\{t\}\.
Interpretation\.The MACD measures momentum by comparing short\- and long\-term EMAs\. A positive value implies upward acceleration; negative values imply downward momentum\. Crossover events between MACD and the signal line indicate potential reversals, while histogram expansion suggests strengthening momentum\. Because MACD captures the rate of change in trend direction, it is frequently used in HFT environments for detecting early inflection points\.
### B\.2 Relative Strength Index \(RSI\)
Definition\.The Relative Strength Index \(RSI\) quantifies the internal strength of recent price movements by comparing average gains to average losses within a defined lookback periodnn\(typicallyn=14n=14\)\. For a price differenceΔPt=Pt−Pt−1\\Delta P\_\{t\}=P\_\{t\}\-P\_\{t\-1\}:
AvgGaint=EMAn\(max\(ΔPt,0\)\)\\text\{AvgGain\}\_\{t\}=\\text\{EMA\}\_\{n\}\(\\max\(\\Delta P\_\{t\},0\)\)AvgLosst=EMAn\(max\(−ΔPt,0\)\)\.\\text\{AvgLoss\}\_\{t\}=\\text\{EMA\}\_\{n\}\(\\max\(\-\\Delta P\_\{t\},0\)\)\.The relative strength \(RS\) and RSI are then computed as:
RSt=AvgGaintAvgLosst,RSIt=100−1001\+RSt\.RS\_\{t\}=\\frac\{\\text\{AvgGain\}\_\{t\}\}\{\\text\{AvgLoss\}\_\{t\}\},\\qquad\\text\{RSI\}\_\{t\}=100\-\\frac\{100\}\{1\+RS\_\{t\}\}\.
Interpretation\.RSI values oscillate between 0 and 100, serving as a bounded momentum oscillator\. Readings above 70 denote overbought conditions \(potential reversal risk\), while readings below 30 suggest oversold conditions \(potential recovery\)\. Crossings of the 50 midpoint line are interpreted as transitions in trend dominance\. In high\-frequency contexts, RSI slope and failure\-swing formations provide early warnings of momentum exhaustion before price reversal becomes visible\.
### B\.3 Anchored Volume Weighted Average Price \(AVWAP\)
Definition\.The Anchored Volume Weighted Average Price \(AVWAP\) extends the conventional VWAP by fixing the accumulation anchor to a specific event timeτ\\tau\(e\.g\., major news or breakout\)\. It represents the cumulative volume\-weighted mean of traded prices since the anchor point:
AVWAPt=∑i=τtPiVi∑i=τtVi,\\text\{AVWAP\}\_\{t\}=\\frac\{\\sum\_\{i=\\tau\}^\{t\}P\_\{i\}V\_\{i\}\}\{\\sum\_\{i=\\tau\}^\{t\}V\_\{i\}\},wherePiP\_\{i\}denotes the typical or closing price andViV\_\{i\}the corresponding trading volume\.
Interpretation\.AVWAP serves as a dynamic “fair value” benchmark representing the mean price paid per traded volume since a specific anchor\. When price trades above AVWAP, the market is said to be in a bullish premium phase; when below, in a bearish discount phase\. Because institutional participants often reference anchored VWAP levels for liquidity decisions, these lines act as adaptive support or resistance zones in HFT systems\.
### B\.4 Simple Moving Average \(SMA\)
Definition\.The Simple Moving Average \(SMA\) is a non\-weighted mean of the most recentnnclosing prices:
SMAt=1n∑i=0n−1Pt−i\.\\text\{SMA\}\_\{t\}=\\frac\{1\}\{n\}\\sum\_\{i=0\}^\{n\-1\}P\_\{t\-i\}\.For two SMAs with different windowsn1<n2n\_\{1\}<n\_\{2\}, the crossover betweenSMAn1\\text\{SMA\}\_\{n\_\{1\}\}andSMAn2\\text\{SMA\}\_\{n\_\{2\}\}provides directional signals\.
Interpretation\.SMA acts as a linear filter that removes short\-term noise to reveal the underlying trend\. Shorter\-period SMAs respond quickly to price fluctuations, while longer\-period SMAs define macro\-trend bias\. The alignment of multiple SMAs into a monotonic order \(short \> medium \> long\) indicates trend strength, whereas frequent crossovers reflect low directional conviction or range\-bound conditions\.
### B\.5 Stochastic Oscillator
Definition\.The Stochastic Oscillator measures the relative position of the current close within a recent price range of lengthnn:
%Kt=100×Pt−LnHn−Ln,%Dt=SMA3\(%Kt\),\\%K\_\{t\}=100\\times\\frac\{P\_\{t\}\-L\_\{n\}\}\{H\_\{n\}\-L\_\{n\}\},\\quad\\%D\_\{t\}=\\text\{SMA\}\_\{3\}\(\\%K\_\{t\}\),whereHn=max\(Pt−n\+1,…,Pt\)H\_\{n\}=\\max\(P\_\{t\-n\+1\},\\dots,P\_\{t\}\)andLn=min\(Pt−n\+1,…,Pt\)L\_\{n\}=\\min\(P\_\{t\-n\+1\},\\dots,P\_\{t\}\)denote the highest and lowest prices in the pastnnperiods \(commonlyn=14n=14\)\.
Interpretation\.The Stochastic Oscillator quantifies momentum relative to the recent range rather than absolute changes\. Readings above 80 signify potential overbought conditions, while values below 20 indicate oversold conditions\. Crossovers between %K and %D provide early entry and exit signals\. In HFT environments, the slope and curvature of %K serve as short\-term acceleration indicators, and divergence between Stochastic and price action often precedes directional reversal\.
### B\.6 Heiken Ashi \(HA\)
Definition\.Heiken Ashi candlesticks are a transformation of traditional OHLC data that average and smooth price information to reduce noise\. The recursive formulation is:
HA\_Closet\\displaystyle\\text\{HA\\\_Close\}\_\{t\}=14\(Ot\+Ht\+Lt\+Ct\),\\displaystyle=\\tfrac\{1\}\{4\}\(O\_\{t\}\+H\_\{t\}\+L\_\{t\}\+C\_\{t\}\),HA\_Opent\\displaystyle\\text\{HA\\\_Open\}\_\{t\}=12\(HA\_Opent−1\+HA\_Closet−1\),\\displaystyle=\\tfrac\{1\}\{2\}\(\\text\{HA\\\_Open\}\_\{t\-1\}\+\\text\{HA\\\_Close\}\_\{t\-1\}\),HA\_Hight\\displaystyle\\text\{HA\\\_High\}\_\{t\}=max\(Ht,HA\_Opent,HA\_Closet\),\\displaystyle=\\max\(H\_\{t\},\\text\{HA\\\_Open\}\_\{t\},\\text\{HA\\\_Close\}\_\{t\}\),HA\_Lowt\\displaystyle\\text\{HA\\\_Low\}\_\{t\}=min\(Lt,HA\_Opent,HA\_Closet\)\.\\displaystyle=\\min\(L\_\{t\},\\text\{HA\\\_Open\}\_\{t\},\\text\{HA\\\_Close\}\_\{t\}\)\.
Interpretation\.Heiken Ashi averages smooth intra\-period volatility to better capture directional persistence\. Extended sequences of uniform\-color candles represent strong trends, while small\-bodied candles or alternating colors indicate weakening momentum or consolidation\. This transformation is particularly useful in high\-frequency applications, where standard candlestick noise can obscure subtle but statistically persistent directional biases\.
## Appendix CCase Study
This case study illustrates a full trading cycle withinMETA, from signal perception to reflective memory update\. Each trade begins with inputK\-linedata analyzed in parallel by specializedIndicator Agents\(e\.g\., MACD, RSI, AVWAP, SMA, Stochastic, Heiken Ashi\), each generating a structured signal report\. These outputs form anindicator vectorthat encodes the current market state and is used to retrieve historically similar episodes from the memory base through cosine similarity search\. The retrieved memories, together with real\-time analyses, are then passed to theDecision Agentfor synthesis into a trading action \(Long,Short, orHold\) with associated confidence\. Following trade execution, theReflection Moduleevaluates the outcome and updates the episodic memory—adding, refining, or pruning trade instances to ensure continual learning and adaptive decision\-making\.
Trend Agent Output Response1\. Trendline Interaction:•The price is interacting with both the support \(blue\) and resistance \(red\) lines\.•Recent candles have bounced off the support line, indicating it is holding for now\.•The resistance line has been tested multiple times, with the price failing to break through\.2\. Trendline Slope:•Both the support and resistance lines are sloping downward, indicating a bearish trend\.3\. Recent K\-line Behavior:•The price is compressing between the support and resistance lines, showing consolidation\.•There is a slight downward bias as the price is closer to the support line\.Prediction:Downward TrendReasoning:•The downward slope of both trendlines suggests a bearish trend\.•The price is closer to the support line, and repeated tests of this line may lead to a breakdown\.•The inability to break above the resistance line indicates strong selling pressure\.Signals:•Watch for a break below the support line for confirmation of a downward move\.•If the price breaks above the resistance line, it could indicate a reversal, but current signals favor a downward trend\.
MACD Agent Output ResponseMACD Analysis:1\. Signal Line Crossovers:•The MACD line \(blue\) is currently below the signal line \(red\), indicating a bearish crossover\.•This crossover occurs below the zero line, reinforcing bearish momentum\.2\. Zero Line Crossovers:•The MACD line is below zero, indicating negative momentum\.•No recent crossovers of the zero line, suggesting sustained bearish momentum\.3\. Histogram Analysis:•The histogram bars are contracting, indicating weakening bearish momentum\.•No recent histogram zero\-line crossovers, but the contraction suggests a potential momentum shift\.4\. Divergence Patterns:•No clear bullish or bearish divergences observed between price action and MACD behavior\.•Price lows align with MACD lows, confirming current trend\.5\. Momentum Strength:•The MACD line is significantly below zero, indicating strong bearish momentum\.•Both MACD and signal lines are sloping downward, but the slope is decreasing, suggesting deceleration\.Conclusion:•Primary Signal:Hold•Momentum Direction:Bearish•Confidence Level:Medium•Key Supporting Evidence:Bearish crossover below zero line, contracting histogram\.•Risk Considerations:Potential for false signals due to histogram contraction; watch for any bullish crossover or divergence for a trend reversal\.
AVWAP Agent Output Response1\. Support/Resistance Analysis:•Price Position:The price is currently below the AVWAP line\.•Price Reaction:The price has been rejected at the AVWAP line multiple times, indicating it is acting as resistance\.•Dynamic Role:AVWAP is acting as dynamic resistance in a downtrend\.2\. Mean Reversion Opportunities:•Deviation:The price has deviated significantly below the AVWAP, suggesting a potential pullback to fair value\.•Extreme Stretches:The current stretch below AVWAP suggests a possible mean reversion opportunity\.•Typical Range:The price has shown a tendency to revert to the AVWAP after deviations\.3\. Breakout/Breakdown Signals:•Decisive Breaks:There have been decisive breaks below the AVWAP with strong volume\.•Reclaiming/Losing AVWAP:The price has lost the AVWAP after being above it\.•Volume Behavior:Volume spikes coincide with AVWAP tests and breakdowns\.4\. AVWAP Slope and Bias:•Slope:The AVWAP line is sloping downward, indicating a bearish bias\.•Steepness:The slope is moderately steep, suggesting a strong directional bias\.•Slope Dynamics:The slope is consistent, maintaining a bearish trend\.5\. Fair Value Assessment:•Institutional Fair Value:The AVWAP level represents institutional fair value\.•Price Position:Current prices are trading at a discount to volume\-weighted fair value\.•Evolution:The fair value relationship has shifted from premium to discount as the session progressed\.6\. Volume\-Price Relationship:•Volume Increase:Volume increases when the price approaches the AVWAP\.•Volume Spikes:Notable volume spikes occur during AVWAP tests and breakdowns\.•Volume Support:Volume supports the current bearish price action relative to AVWAP\.Comprehensive Assessment:•Primary Trade Signal:Sell–Rationale:The price is below a downward\-sloping AVWAP, acting as resistance with strong volume confirmation\.•AVWAP Bias:Bearish–Based on:Downward slope and price position below AVWAP\.•Fair Value Assessment:Discount–Relative to AVWAP:Current prices are below the volume\-weighted fair value\.•Entry Strategy:–Approach:Enter short positions on rallies towards the AVWAP with confirmation of rejection\.•Risk Management:–Stop Loss:Above recent highs near the AVWAP\.–Profit Target:At recent lows or further below, considering trend continuation\.•Volume Confirmation:–Support:Volume supports the bearish signal, with spikes during AVWAP interactions confirming resistance\.This analysis suggests a continuation of the downtrend, with AVWAP serving as a key resistance level\.
Heiken Ashi Agent Output ResponseHeiken Ashi Analysis1\. Trend Direction & Consistency:•Consecutive Candles:There is a sequence of green candles followed by a longer sequence of red candles\.•Dominant Color:Red candles dominate, indicating a bearish trend\.•Recent Color Changes:A few green candles appear at the end, suggesting a potential shift\.•Trend Cleanliness:The trend is relatively clean with minimal alternation during the bearish phase\.2\. Trend Strength Indicators:•Candle Bodies:Initially large green bodies, followed by large red bodies, indicating strong momentum in both directions\.•Wicks:Red candles have minimal upper wicks, showing strong bearish momentum\.•Body Size:Decreasing body size towards the end of the red sequence suggests deceleration\.3\. Reversal Pattern Recognition:•Doji\-like Formations:Some small\-bodied candles with wicks appear, indicating indecision\.•Color Change:Green candles after a strong red sequence suggest a potential reversal\.•Spinning Tops/Hammer\-like Patterns:Present towards the end of the red sequence\.4\. Momentum Acceleration/Deceleration:•Candle Size:Recent candles are smaller, indicating fading momentum\.•Gaps:No significant gaps observed\.•Wick Reduction:Progressive wick reduction in the bearish direction\.5\. Consolidation vs Trending Phases:•Color Alternation:Recent alternation suggests a potential consolidation phase\.•Small Bodies with Long Wicks:Indicate range\-bound action\.6\. Entry/Exit Signal Quality:•Signal Quality:Medium confidence due to recent indecision and potential reversal signals\.•Optimal Entry Points:Consider buying if a strong green candle confirms a reversal\.•Trend Exhaustion:Watch for further green candles to confirm trend change\.7\. Multi\-Candle Pattern Analysis:•Three Consecutive Same\-Color Candles:Present in both green and red sequences, confirming trends\.•Two\-Candle Reversal Patterns:Potential reversal pattern forming with recent green candles\.•Extended Trend Sequences:Red sequence nearing exhaustion\.Comprehensive Assessment:•Trend Status:Weak Bearish transitioning to Sideways•Momentum Phase:Decelerating•Signal Quality:Medium•Trading Action:Wait for better setup•Entry Strategy:Look for a strong green candle to confirm reversal before entering a buy position\.•Exit Criteria:Exit if red candles reappear with strong bodies and minimal wicks\.•Risk Assessment:Moderate probability of false signals due to recent indecision and small\-bodied candles\.
SMA Agent Output ResponseSMA Analysis:1\. Trend Identification:•Price/SMA Relationship:The price is currently below both the 20\-period \(blue\) and 40\-period \(red\) SMAs, indicating a bearish trend\.•SMA Alignment:The 20\-period SMA is below the 40\-period SMA, reinforcing the downtrend\.2\. Moving Average Crossovers:•Death Cross:The 20\-period SMA has crossed below the 40\-period SMA, confirming a bearish signal\.•Recent Crossovers:No recent golden cross observed; the last significant crossover was bearish\.3\. Dynamic Support/Resistance:•Support:Price is not finding support at the SMAs; it is below both\.•Resistance:The 20\-period SMA is acting as resistance during rallies\.•Respect of Levels:Price has consistently stayed below the SMAs, respecting them as resistance\.4\. Multiple MA Ribbon Analysis:•SMA Stacking:The SMAs are neatly stacked with the shorter below the longer, indicating a strong bearish trend\.•Ribbon Behavior:The ribbon is fanning out, suggesting a strengthening downtrend\.5\. Mean Reversion Signals:•Price Extension:Price is significantly extended below the SMAs, indicating potential for a mean reversion or pullback\.•Deviation:The price is stretched, suggesting a possible short\-term reversal\.6\. Slope and Alignment:•SMA Slopes:Both SMAs are sloping downwards, indicating a strong bearish trend\.•Alignment:SMAs are aligned in the same downward direction, confirming trend strength\.•Slope Steepness:The slopes are moderately steep, indicating a strong trend\.Conclusion:•Primary Trend Direction:Bearish•Trend Strength:Strong•Trading Bias:Sell on Rallies•Key SMA Levels:Watch the 20\-period SMA \(∼\\sim86000\) as resistance\.•Confirmation Needed:Look for confirmation from other indicators like RSI for oversold conditions or MACD for momentum confirmation\.This analysis suggests a strong bearish trend with potential short\-term pullbacks\. Traders should consider selling on rallies, especially if price approaches the 20\-period SMA resistance\.
Stochastic Oscillator Agent Output ResponseStochastic Oscillator Analysis:1\. Overbought/Oversold Conditions:•The Stochastic is currently below the 20 level, indicating oversold conditions\.•It has been in the oversold zone for a short period\.•There is no clear exit from the oversold zone yet, suggesting a potential continuation of the current trend\.2\. Line Crossovers:•The %K line is crossing above the %D line, which is a bullish signal\.•This crossover is occurring in the oversold zone, which can indicate a potential reversal\.3\. Divergence Patterns:•There is no clear bullish divergence as the price and Stochastic both show lower lows\.•No bearish divergence is present\.4\. Failure Swings:•No clear bullish failure swing is observed as the Stochastic has not made a higher low in the oversold territory\.•No bearish failure swing is present\.5\. Centerline Analysis:•The Stochastic is below the 50 centerline, indicating bearish momentum\.•A crossover above 50 would suggest a shift to bullish momentum, but this has not occurred yet\.6\. Slope and Momentum:•The %K line is starting to slope upwards, indicating a potential increase in bullish momentum\.•The %D line is also beginning to turn upwards, supporting the potential for a bullish reversal\.•Both lines are making lower highs and lows, consistent with the current downtrend\.Conclusion:•Primary Signal:Hold•Momentum Direction:Neutral to Bullish \(potential reversal\)•Confidence Level:Medium•Key Supporting Evidence:Bullish crossover in oversold zone, upward slope of %K and %D lines\.•Risk Considerations:The Stochastic is still in the oversold zone, and the overall trend is bearish\. There is a risk of false signals if the price does not confirm the reversal\.This analysis suggests caution, as the bullish signals are emerging but not yet confirmed by price action\.
RSI Agent Output ResponseRSI Analysis:1\. Overbought/Oversold Conditions:•The RSI is not currently in overbought \(\>70\) or oversold \(<30\) territory\. It is around the 40 level\.•There is no recent crossover from these extreme zones\.2\. Centerline Crossovers:•The RSI is below the centerline \(50\), indicating bearish momentum\.•There have been no recent crossovers of the 50 level\.3\. Failure Swings:•No clear failure swings are observed as RSI hasn’t reached extreme levels recently\.4\. Divergence Patterns:•Bullish Divergence:The price made a lower low, while RSI made a higher low, suggesting potential bullish reversal\.5\. RSI Trendlines & Patterns:•No visible trendlines or chart patterns like triangles are apparent on the RSI\.6\. Swing Rejection Patterns:•No clear swing rejection patterns are observed\.7\. RSI Range Analysis:•RSI is ranging between 30 and 50, showing bearish momentum but not extreme exhaustion\.•Recent support around 30 and resistance near 50\.Conclusion:•Primary Signal:Hold•Momentum Direction:Bearish•Confidence Level:Medium•Key Supporting Evidence:Bullish divergence observed, but overall momentum remains bearish\.•Risk Considerations:Potential for false signals due to lack of strong reversal patterns and RSI not reaching extreme levels\.The bullish divergence suggests a possible reversal, but the overall bearish momentum and lack of strong reversal signals warrant caution\.
After analyzing the current market state, META encodes the aggregated indicator outputs into anindicator vectorand retrieves the most similar past trades from memory\. These analogous cases serve as experiential references, anchoring the decision process in prior market behaviors\.
Retrieved Memory 1 \(Similarity: 0\.89\)Date:2025\-09\-30T17:47:07\.801365Forecast Horizon:Next 4\-hour candlestick predictionConfidence Level:MediumPrimary Drivers:•Descending Triangle pattern indicating potential bearish breakout•Price below VWAP and SMAs, confirming bearish trendMemory Insights:No highly relevant past trade memories found for current market conditions\.Justification:The analysis suggested a bearish sentiment with indicators pointing toward oversold conditions\. The descending triangle and price positioning below key moving averages supported a continuation of the downward trend\.Risk–Reward Ratio:1\.5Stop\-Loss Rationale:Stop loss placed above recent resistance to mitigate reversal risk in alignment with the bearish setup\.Decision:ShortOutcome:387\.31Reflection:The trade’s success stemmed from correctly identifying the descending triangle and confirming bearish momentum via VWAP and SMA alignment\. Effective risk management further supported profitability\. However, the medium confidence rating highlights an opportunity to enhance robustness through expanded historical referencing and refined indicator weighting in future decisions\.
Retrieved Memory 2 \(Similarity: 0\.83\)Date:2025\-09\-17T15:16:46\.572820Forecast Horizon:Next 4\-hour candlestick predictionConfidence Level:MediumPrimary Drivers:•Price below both 20 and 40\-period SMAs indicating a bearish trend•MACD line significantly below signal line with negative histogram indicating strong bearish momentum•Price below downward\-sloping AVWAP acting as resistanceMemory Insights:Previous scenarios with similar bearish setups have shown mixed outcomes, highlighting the need for cautious confidence and dynamic risk management\.Justification:Technical indicators including the MACD, SMAs, and AVWAP suggested a continuation of the bearish trend\. Historical analysis supported this decision, though with mixed results\.Risk–Reward Ratio:1\.5Stop\-Loss Rationale:Stop loss placed above recent highs near the AVWAP to manage reversal risk\.Decision:ShortOutcome:–76\.69Reflection:The loss arose from overreliance on technical bearish signals that failed to materialize\. Future improvements include better weighting of historical insight, adaptive stop\-loss adjustment, and accounting for broader market factors\.
Retrieved Memory 3 \(Similarity: 0\.83\)Date:2025\-09\-18T16:40:44\.859425Forecast Horizon:Next 4\-hour candlestick predictionConfidence Level:MediumPrimary Drivers:•Price below both 20 and 40\-period SMAs indicating a bearish trend•MACD line below signal line with negative histogram indicating bearish momentum•Descending Triangle pattern suggesting bearish breakoutMemory Insights:Similar setups with descending triangles and bearish indicators have produced mixed outcomes, calling for cautious confidence\.Justification:The bearish alignment of MACD, SMAs, and chart pattern supported a short position\. Historical results validated this setup\.Risk–Reward Ratio:1\.5Stop\-Loss Rationale:Stop loss placed above recent highs near the AVWAP\.Decision:ShortOutcome:571\.08Reflection:Profit resulted from precise identification of the descending triangle and indicator alignment\. The trade confirms the importance of weighted indicator calibration and dynamic confidence scaling\.
Retrieved Memory 4 \(Similarity: 0\.82\)Date:2025\-09\-16T17:21:41\.742237Forecast Horizon:Next 4\-hour candlestick predictionConfidence Level:MediumPrimary Drivers:•MACD line below signal line with negative histogram indicating bearish momentum•Price below both 20 and 40\-period SMAs confirming downtrend•Descending Triangle pattern suggesting potential breakdownMemory Insights:Prior successful shorts in similar descending triangle setups with bearish indicators\.Justification:Strong bearish signals supported a short trade\. Historical parallels suggested profit potential\.Risk–Reward Ratio:1\.5Stop\-Loss Rationale:Stop loss placed above recent highs near the AVWAP\.Decision:ShortOutcome:–150\.00Reflection:The loss resulted from overestimating bearish momentum\. Future improvements include multi\-signal confirmation, contextual confidence scaling, and indicator reweighting\.
Retrieved Memory 5 \(Similarity: 0\.81\)Date:2025\-09\-20T00:33:33\.390160Forecast Horizon:Next 4\-hour candlestick predictionConfidence Level:MediumPrimary Drivers:•RSI and Stochastic Oscillator in oversold territory indicating potential reversal•Bullish crossover in Stochastic Oscillator•Price trading below VWAP suggesting potential undervaluationMemory Insights:Oversold conditions and bullish crossovers often lead to short\-term reversals in past cases\.Justification:Despite a bearish backdrop, RSI, Stochastic, and VWAP indicated undervaluation warranting a cautious long\.Risk–Reward Ratio:1\.5Stop\-Loss Rationale:Stop loss placed below recent lows to mitigate continuation risk\.Decision:LongOutcome:76\.69Reflection:Success stemmed from recognizing oversold conditions and aligning multiple reversal signals\. Future enhancements include dynamic indicator weighting and adaptive confidence tuning based on confluence strength\.
The retrieved memories provide valuable contextual grounding for the current trade\. By examining both profitable and unprofitable precedents, META’s synthesis stage integrates lessons from historical performance into the present decision\-making process\. Profitable cases such as Memory 3 highlight the effectiveness of aligning descending triangle patterns with bearish indicator convergence, reinforcing confidence in similar market setups\. Conversely, losses observed in Memory 2 and Memory 4 underscore the risks of overreliance on technical signals without sufficient contextual validation or adaptive stop\-loss control\. Through reflective comparison, META dynamically adjusts the weighting of key indicators—such as MACD, SMA alignment, and AVWAP slope—while moderating confidence when past patterns exhibit mixed outcomes\. This learning mechanism enables the agent to refine its strategy beyond static rule\-following, improving robustness by encoding both the strengths and weaknesses of prior trades into future reasoning\.
Decision Agent Output ResponseForecast Horizon:Next 4h candlestick predictionDecision:SHORT Confidence Level:MediumPrimary Drivers:•Descending Triangle pattern indicating potential bearish breakout•Price below both 20 and 40\-period SMAs confirming downtrend•MACD line below signal line with negative histogram indicating bearish momentumMemory Insights:Previous similar setups with descending triangle patterns and price below key moving averages have resulted in mixed outcomes, highlighting the need for cautious confidence and dynamic risk management\.Justification:The current market analysis shows a strong bearish trend with the price below key moving averages and a descending triangle pattern suggesting a potential breakdown\. Historical memory supports the decision to short in similar conditions, where the alignment of technical indicators led to both successful and unsuccessful outcomes\. The overall bearish sentiment is reinforced by the price’s position below key moving averages and the AVWAP\.Risk–Reward Ratio:1\.5 Stop\-Loss Rationale:Place stop loss above recent highs near the AVWAP to manage risk in case of a reversal\.
Simulated Trade OutcomeOutcome:WIN PnL:\+615\.30 Entry Price:82,548\.81 Exit Price:81,933\.51Performance Summary:The trade achieved a profitable outcome, with price movement aligning closely to the anticipated bearish continuation\. Execution adhered to the risk–reward target of 1\.5, validating both directional accuracy and the stop\-loss placement strategy\.
Trade ReflectionThe key factors that led to the profitable outcome were the accurate identification of the descending triangle pattern and the confirmation of bearish momentum through the MACD and moving averages\. The original analysis was sound, as the primary drivers correctly predicted market movement, and historical memory insights provided a balanced perspective on risk management\.However, the medium confidence level suggests there was room for greater conviction given the alignment of technical indicators\. For future scenarios, it would be beneficial to emphasize pattern strength and multi\-indicator confluence, adjusting confidence upward in similar conditions\. Additionally, refining stop\-loss placement to account for volatility could further improve risk management and trade robustness\.
Following the trade’s completion and reflection phase, META transitions into the final stage of its cognitive workflow—theMemory Consolidation Phase\. In this stage, theMemory Operator\(Ψ\\Psi\) evaluates the outcome of the trade alongside retrieved precedents to determine how the memory base should evolve\. Based on the reflection, past memories may be updated, retained, or removed, while the newly completed trade is encoded as a new episodic memory\. This process ensures that the agent’s experiential knowledge remains both adaptive and performance\-oriented, continually refining its future decision quality\.
Memory Agent Output ResponsePost\-Trade Memory Operations:•Memory 1:NOOP— retained without modification\.•Memory 2:NOOP— maintained as historical reference\.•Memory 3:UPDATE— performance data appended with revised confidence weighting\.•Memory 4:DELETE— removed due to repeated underperformance in similar contexts\.•Memory 5:UPDATE— outcome consistency improved; metadata refined for future retrieval weighting\.•New Memory:ADD— stored as a new episodic record representing the current trade outcome and reflection\.Summary:The Memory Operator integrates experiential feedback by updating profitable analogs, pruning uninformative cases, and adding the newly completed trade as a fresh memory entry\. This targeted consolidation ensures the memory base remains relevant, adaptive, and performance\-aligned across future retrieval cycles\.
This case study illustrates META’s complete cognitive workflow, demonstrating how the system transforms perception\-driven analysis into experience\-informed reasoning\. By integrating insights from multiple indicator agents, META constructs a structured representation of the market state that captures both short\-term and long\-term dynamics\. The retrieval of analogous trade memories provides contextual grounding, enabling the decision agent to synthesize new judgments with awareness of past outcomes\. Finally, the reflection and memory consolidation stages close the cognitive loop, allowing the agent to refine its internal knowledge base through targeted updates and selective forgetting\.
Through this process, META exhibits several key advantages: \(1\) it enhances predictive stability by grounding real\-time reasoning in historical evidence; \(2\) it maintains interpretability through explicit agent\-level outputs; and \(3\) it achieves continual learning without retraining, instead relying on reflection\-driven memory management\. Together, these mechanisms position META as a step toward genuinely adaptive, self\-improving trading intelligence capable of evolving alongside dynamic market conditions\.
## Appendix DMetrics Design
To ensure comparability with prior work, we adopt the evaluation metrics introduced inQuantAgent\([Xiong et al\., 2026](https://arxiv.org/html/2609.28771#bib.bib27)\), which quantify both predictive accuracy and profitability under risk\-constrained execution\. All metrics are computed within a fixed three\-candlestick horizon, corresponding to the short\-term forecasting window defined by the trading agent\.
#### Directional Accuracy \(α\\alpha\)\.
Directional accuracy measures the model’s consistency in predicting the correct price movement over the next three candlesticks\. For aLONGdecision, each candle that closes above the current close counts as a correct prediction; for aSHORTdecision, each candle that closes below the current close counts\. The accuracy is given by:
whereCCdenotes the number of correctly predicted candles andT=3T=3the evaluation horizon\. This formulation aligns with the Mean Directional Accuracy metric used in financial forecasting\.
#### Rate\-of\-Return \(RoR\) Metrics\.
To evaluate trade profitability and risk exposure, we measure multiple forms of rate of return between the entry and exit prices, incorporating realistic stop\-loss and take\-profit execution\. The base stop\-loss thresholdρ\\rhois fixed at0\.00050\.0005\(0\.05%\), while the reward threshold is determined by the model\-generated risk–reward ratiorr, yielding a maximum allowed gainR=r⋅ρR=r\\cdot\\rhoand maximum loss−r⋅ρ\-r\\cdot\\rho:
R=r⋅ρ,ρ=0\.0005\.R=r\\cdot\\rho,\\quad\\rho=0\.0005\.Each trade is exited at the first intra\-candle price that hits either threshold\.
- •Cumulative Return \(RccR\_\{cc\}\):The realized return over the forecast horizon, reflecting the net gain or loss achieved at the earliest hit of either the take\-profit or stop\-loss limit: Rcc=\{Pexit−PentryPentry,if LONG,Pentry−PexitPentry,if SHORT\.R\_\{cc\}=\\begin\{cases\}\\dfrac\{P\_\{\\text\{exit\}\}\-P\_\{\\text\{entry\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if LONG,\}\\\\\[6\.0pt\] \\dfrac\{P\_\{\\text\{entry\}\}\-P\_\{\\text\{exit\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if SHORT\.\}\\end\{cases\}This simulates a risk\-managed intra\-candle execution with bounded return outcomes\.
- •Maximum Return \(RmaxR\_\{\\max\}\):The best\-case rate of return achievable over the same window, assuming an optimal intra\-candle exit: Rmax=\{Phigh−PentryPentry,if LONG,Pentry−PlowPentry,if SHORT\.R\_\{\\max\}=\\begin\{cases\}\\dfrac\{P\_\{\\text\{high\}\}\-P\_\{\\text\{entry\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if LONG,\}\\\\\[6\.0pt\] \\dfrac\{P\_\{\\text\{entry\}\}\-P\_\{\\text\{low\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if SHORT\.\}\\end\{cases\}RmaxR\_\{\\max\}represents the upper bound of potential profit\.
- •Minimum Return \(RminR\_\{\\min\}\):The most adverse price movement within the same horizon: Rmin=\{Plow−PentryPentry,if LONG,Pentry−PhighPentry,if SHORT\.R\_\{\\min\}=\\begin\{cases\}\\dfrac\{P\_\{\\text\{low\}\}\-P\_\{\\text\{entry\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if LONG,\}\\\\\[6\.0pt\] \\dfrac\{P\_\{\\text\{entry\}\}\-P\_\{\\text\{high\}\}\}\{P\_\{\\text\{entry\}\}\},&\\text\{if SHORT\.\}\\end\{cases\}RminR\_\{\\min\}captures the worst\-case drawdown under identical trade direction\.
- •Similarity\-weighted Return Alignment \(RsimR\_\{\\text\{sim\}\}\):This metric assesses the consistency between similarity scores of retrieved memories and realized profitability\. For each tradeii, with similarity weightswijw\_\{ij\}overkkretrieved episodes and their respective realized returnsRcc\(j\)R\_\{cc\}^\{\(j\)\}, we define: Rsim=1N∑i=1N∑j=1kwij⋅Rcc\(j\)∑j=1kwij,R\_\{\\text\{sim\}\}=\\frac\{1\}\{N\}\\sum\_\{i=1\}^\{N\}\\frac\{\\sum\_\{j=1\}^\{k\}w\_\{ij\}\\cdot R\_\{cc\}^\{\(j\)\}\}\{\\sum\_\{j=1\}^\{k\}w\_\{ij\}\},whereNNis the number of evaluated trades\. HigherRsimR\_\{\\text\{sim\}\}values indicate that the retrieval mechanism successfully identifies memories whose return patterns align with the current market context\.
Together, these metrics provide a comprehensive view of agent performance:α\\alphameasures directional accuracy;RccR\_\{cc\}reflects realized profitability;RmaxR\_\{\\max\}andRminR\_\{\\min\}establish upper and lower risk bounds; andRsimR\_\{\\text\{sim\}\}quantifies the semantic consistency between retrieved experiences and market outcomes\. This unified metric suite captures predictive precision, profitability, and memory relevance under realistic HFT execution conditions, fully aligned with the QuantAgent evaluation protocol\.
## Appendix EUse of Large Language Models \(LLMs\)
Large Language Models \(LLMs\) were employed solely as supportive instruments to improve the clarity, coherence, and grammatical precision of the manuscript\. Specifically, GPT\-5 was utilized to refine portions of the text—primarily within the Introduction and Methodology sections—to ensure readability and stylistic consistency\. The authors retain full responsibility for all scientific and technical contributions, including the formulation of research questions, experimental design, implementation of theMETAframework, and validation of empirical findings\. The use of LLMs was limited strictly to editorial assistance and did not influence the conceptual, analytical, or experimental aspects of this work\.Similar Articles
AdMem: Advanced Memory for Task-solving Agents
This paper introduces AdMem, a unified memory framework for LLM-based agents that integrates semantic, episodic, and procedural memory with a bi-level short-term and long-term store, using a multi-agent architecture for automatic memory generation and adaptive retrieval. Experiments show improved robustness and success on long multi-turn tasks.
Beyond Retrieval: Analytic Memory for Multimodal Agents
This paper introduces AdaMM, a framework that complements retrieval-based multimodal memory with analytic memory, enabling filtering, aggregation, ranking, and temporal comparison over accumulated observations. Experiments on MemEye and MemGallery benchmarks show improvements of up to 11.3% and 7.3% respectively.
MACTS-EM: Multi-Agent Collaborative Time Series Forecasting with Emergent Memory
The paper introduces MACTS-EM, a multi-agent collaborative framework for time series forecasting that uses specialised agents, a meta-cognitive layer, emergent memory, and multimodal integration, reporting 8-12% accuracy gains and improved zero-shot transfer and regime-shift resilience across financial, climate, energy, and pandemic datasets.
MESA:Task-Adaptive Multi-Structure Evidence Selection for Long-Horizon Agent Memory
This paper introduces MESA, a framework that dynamically selects and fuses a query-adaptive subset of multiple structural memory views for long-horizon agents, achieving 8.5% accuracy improvement over the strongest baseline while using 41% fewer evidence tokens.
Agent Memory: An Anatomy
An exploration of the components and design decisions behind agent memory libraries, clarifying the gap between cognitive science terminology and engineering implementation.