メインコンテンツへ移動 / Skip to main content

What I Learned from Trading FX with LLMs

A detailed log of building an AI-powered automated FX trading system and running it live for a month, revealing what LLMs are bad at and where they actually shine.

AI自動売買システムのインターフェース
Technology
Published on: August 10, 2026
Read time: 8 min
Author: Pochang Lab
Read time: 8 min

1. Conclusion: LLMs Aren't Suited for Price Prediction, But They Transform How You Approach the Market

Until now, I’ve kept quiet about the automated FX trading system I’ve been building.

To be completely honest, I fully believed that "combining traditional automated trading with the decision-making power of modern AI (LLMs) would create an overwhelming edge." And if it really could win consistently, I wanted to keep that know-how to myself and monopolize the profits. In the trading world, the moment an edge is made public, it gets learned by other participants and disappears.

However, after about a month (July to August 2026) of live trading with real money, I faced a stark reality. The conclusion is simple: "Having AI predict the market to generate consistent profits is not as easy as I hoped." There were definitely winning trades. But the total return sank into the negative. That is precisely why I no longer have a reason to hide it, and why I can share these findings candidly today.

This article isn't just a rejection of AI in trading. It is a practical breakdown—backed by actual code commit logs and the pain of live trading results—clearly separating "what LLMs are bad at" from "where LLMs truly shine."

2. What I Built: A Local Autonomous Trading System via OANDA API

I built an automated FX trading system exclusively for USD_JPY, utilizing the OANDA REST API v20, running entirely as a local process on my MacBook.

In the initial architectural vision, I intended to hand the entire system over to "AI agents" (GPT models). The approach was to feed the AI chart shapes and news, letting the LLM make the final call on when to buy or sell. The Web UI even included an inference panel (using Spark/Codex) to explain "why the AI made this decision," alongside live charts, position management, and auto-entry toggles.

However, in the current architecture, the AI's role has been significantly scaled back.

  • Decision Maker: A local, deterministic Python logic (TrendEngine).
  • AI (LLM) Role: GPT-5.6 Sol is used for "risk monitoring" and "pre-event planning (conditional reservations) during major economic indicators." Terra handles "structured post-trade reflections."
  • Backtest Infrastructure: A custom BacktestReplayEngine designed from scratch. It strictly prevents future price data (Candles) from leaking into the decision step (eliminating lookahead bias).
  • The Core of the Current Implementation (From README.md and commit history)

In short, I fundamentally shifted the architecture from one where the system frequently asks the AI "Should I buy now?" (high-frequency prompt generation) to one where a rule-based Python engine executes the trades, and the AI audits and reviews: "Is this setting flawed?" or "What was the cause of yesterday's loss?"

Side-by-side comparison of the original design where the LLM made the final call on entries and the current design where a deterministic TrendEngine trades while the LLM handles risk monitoring and post-trade reflection

Figure 1: The AI's role, pulled back. It no longer decides; it audits and reflects.

3. Why LLMs Aren't Suited for Price Prediction

The testing period spanning July to August 2026 was an extremely unusual market environment. A coordinated US-Japan currency intervention caused a massive 5-yen plunge in just about 50 minutes. This was coupled with another steep drop driven by a significant downside miss in US employment data, resulting in a period of abnormal volatility. (Note: These findings are based on this highly volatile environment; results may differ in calmer markets.)

In the midst of this turbulence, the limitations of relying on LLMs for price prediction became glaringly obvious.

"Plausible Explanations" vs. "Prediction Accuracy"

An LLM is a language model. It is not designed to find a statistical edge from a numerical sequence of charts (like OHLCV) purely through a mathematical approach. Consequently, when fitting past patterns, it generates highly fluent and persuasive explanations, such as, "A head-and-shoulders top is forming, indicating a high probability of a downtrend." However, logical eloquence and the actual probability of the price moving as predicted are two completely different things. Interestingly, the LLM itself could later reflect and admit, "My prediction was a logical leap, not a fact."

The "Noise Amplification" of High-Frequency Decisions

Initially, I had the AI assess situations on short timeframes like 1-minute or 5-minute charts (traces of this remain in the adjustment history of the AI Watch cadence). However, the higher the decision frequency, the more the system hyper-reacts to "micro-noise" rather than clear signals. If you repeatedly execute entries and exits without a statistical edge at a high frequency, your account balance will inevitably be eroded by the spread (transaction costs).

This was the biggest reason why, despite individual winning trades, the overall total sank into the negative.

4. So, What Did the LLM Actually Excel At?

When I relieved the LLM from the "game of guessing the future" (price prediction), it transformed into an ultimate partner. Its true power lies not in prediction, but in calculation, verification, and pre-design review.

① Catching Trail Width Design Flaws and the Paradox of "Prospect Theory"

During early development, to protect profits, I fixed the trailing stop width at 13 pips (0.13 JPY). When unrealized profits reached several thousand yen, the psychological urge kicked in: "I want to secure at least this much profit for sure." I managed to secure a fixed amount from the peak of unrealized profits once, but I couldn't ride the subsequent upward trend.

Through design reviews with the AI (documented in logs like codex_intervention_history.jsonl), it was pointed out that a 13-pip width was a width guaranteed to be stopped out under the current volatility. In that market, a normal pullback or fluctuation easily moved around 10 pips.

  • The stronger the desire to protect profits, the tighter you make the trail width.
  • A tight width gets stopped out by noise, causing you to miss the subsequent major trend.
Bar comparison showing an ordinary pullback moving about 10 pips against the 13-pip trailing stop that was set, only 3 pips apart

Figure 2: 13 pips sits inside the noise band. The width meant to protect profit could not protect anything.

In other words, I was falling into the trap of Prospect Theory (a cognitive bias): "The stronger the desire to protect profits, the less profit you ultimately make." Following the AI's advice, I improved the system to use an ATR (Average True Range)-based dynamic trailing width, updated only when the candle closes.

② The Stop-and-Reverse (Doten) Trap: Exit Logic != Entry Logic

Another major lesson was the logical asymmetry between "closing a position" and "entering a new position." The hurdle for closing a position is low: "The premise of the uptrend might have collapsed." However, entering a new position in the opposite direction requires a high hurdle of confirmation: "The premise of a downtrend has been established."

Side-by-side contrast showing that closing a position only needs the low bar of a broken premise, while reversing into the opposite direction needs confirmation that a downtrend has formed

Figure 3: Exits and entries need different levels of confirmation. Reusing one as the other is how you get squeezed.

Once, I saw the system execute an automatic trailing stop exit and subconsciously interpreted it as, "The machine has detected a trend reversal." I manually entered a short position (a 'doten' trade). The result? It was just a temporary dip, and I was severely squeezed in the ensuing uptrend. The trailing exit was purely a "mechanical execution" that touched a preset value, with absolutely zero human judgment involved, yet my brain had retroactively applied the meaning, "This is a confirmation of a drop." The post-trade reflection process by the AI (Terra) ruthlessly verified this logical leap.

③ The Illusion of Chart Scale Compression

In my custom Web UI chart implementation, there was an initial issue: when a massive past price movement (like a 5-yen intervention plunge) was included in the display range, the vertical axis auto-adjusted, completely compressing the current price movements visually.

I kept feeling, "The 4-hour chart isn't moving at all," but the market wasn't dead; the display scale was simply too wide, visually destroying the recent volatility. To counter this, I implemented a method to draw only the most recent 'N' bars and dynamically optimize the vertical range (the fit live chart to laptop viewports commit), effectively eliminating this visual bias.

④ The "Self-Amplifying Anxiety Loop" of Switching Timeframes

When you hold a position and the price moves against you, human nature makes you subconsciously search for a timeframe that "justifies your anxiety." If you zoom down to a 10-second chart, you will always find a downward wave somewhere, and you will feel "I'm in trouble."

This isn't analysis; it's a self-amplifying loop of anxiety. The price is a singular fact, yet changing how you view it distorts the truth. To address this, I implemented guardrails in the system: "Fixing the order of observation from higher to lower timeframes" and "Fixing the decision timing to candle closures."

⑤ Reading the Order Book and Its Limitations

The AI helped clarify the difference between unfilled orders (what is going to happen) and open positions (what will be closed). The longer the price stays at a certain level, the more positions accumulate, creating support and resistance (high volume nodes).

However, the limitation, as clearly stated, is that this is merely the customer data of one brokerage. It does not include interbank trading, institutional investors, or orders from authorities conducting interventions. Through dialogue with the AI, I was able to organize the fact that while it's useful as an auxiliary indicator, it shouldn't be the definitive basis for direction.

5. Conclusion: The Work Left for Humans and the Right Distance with AI

AI is unmatched when it comes to calculations—converting pips to currency amounts, quantifying risk, back-calculating required win rates—and detecting inconsistencies in settings.

However, ultimately, in automated trading, "responding to sudden market volatility," "judging macro trends," and above all, "facing your own cognitive biases" cannot be automated.

Do not use an LLM as an "engine that automatically judges and earns money." Instead, use it as a "ruthless design reviewer" that corrects your distorted thinking and exposes inconsistencies in your settings. Let the rules be executed mechanically, and do not let the AI make the decisions.

This is the most productive distance to maintain with AI—a conclusion reached after a month of live trading and countless code revisions.


Disclaimer: This article is a record of technical verification and is not intended as investment advice. Please operate automated trading programs at your own discretion and risk.

Related Articles

March 4, 2026

What Is GPT-5.3 Instant?

A structured explainer of GPT-5.3 Instant covering design goals, latency engineering, accuracy measurements, safety trade-offs, and practical positioning based on public disclosures.

TechnologyRead more
November 12, 2025

Why AI Struggles with Japanese: Structural Barriers, English-Centric Bias, and the Future of Perfect Translation

Explore why AI struggles with Japanese through two key barriers: linguistic structural complexity and English-centric training data. Learn about the causes of misreading and misrecognition, and predict when perfect Japanese AI will emerge.

TechnologyRead more
August 10, 2026

Deconstructing Gemini Spark: 24/7 Always-On AI Agent Architecture

The paradigm shift of 'Autonomous Always-On AI' brought by Gemini Spark. We explore the Long-Horizon execution engine orchestrating Google Workspace and provide a direct comparison with Claude Cowork and Anti-Gravity.

TechnologyRead more
August 6, 2026

Why the Same AI Model Yields Different "Intelligence": The Hidden Prompt Transformations and Autonomous Loops Inside Modern IDEs

"Why do I get different results when using the exact same Claude Opus 5 model?" We dive deep into the "black magic" (context injection, prompt transformation, and hidden LGTM loops) that IDEs perform behind the scenes. Exploring the architectures of Cursor, Claude Code, Devin Desktop, and ChatGPT Codex.

TechnologyRead more
June 15, 2026

The Day AI Got Borders: Will Intelligence Be Export-Controlled?

A long-form essay on the suspension of Claude Fable 5 and Claude Mythos 5, model weights, export controls, cyber defense, technological sovereignty, and who should govern dangerous knowledge.

TechRead more