Reinforcement Learning on GBP/USD: Learning the Trade, Not the Price
A Currency Pair Makes an Unlikely Proving Ground for Machine Traders
Close to one dollar in every ten traded on foreign exchange markets involves the British pound against the US dollar. The Bank for International Settlements put that share at about 9.6 percent in its 2019 survey, which places GBP/USD among the most liquid pairs anywhere. That depth is one reason researchers keep coming back to it.
Liquidity gives a learning system plenty to practice on. Prices arrive constantly, spreads stay tight, and years of history sit ready for training. A model hunting for patterns can collect thousands of decisions from a pair like this, while an individual stock gives it roughly 250 daily bars a year.
Something has changed in the cost of the experiment. Training a recurrent network once demanded serious hardware and weeks of tuning, but a modest graphics card now chews through years of minute-level data in an afternoon. The bottleneck has moved away from raw computing and toward a harder question: what should the model be rewarded for?
The core idea is older than most of the tools. Reinforcement learning grew out of mid-twentieth-century work on adaptive optimal control, where a system adjusts its behavior to maximize a signal from its environment. A trading book fits that frame well, since a position is the action, profit and loss is the signal, and the market never settles into a stable environment.
Financial data makes this harder than a game board. Prices are noisy and nonstationary, so a relationship that held last year may fade next year. Any learned strategy is therefore a bet that some of the past keeps its shape.
Why Learning the Trade Can Beat Learning the Price
Much of reinforcement learning in finance starts by estimating a value function. The agent scores how good each market state is, then derives a trading rule from those scores. Q-learning and temporal-difference methods work this way, and they dominated the field for roughly thirty years.
Value-based methods struggle with markets. A small error in a value estimate can flip the chosen action completely, a sensitivity researchers call brittleness. Forcing trade sizes into discrete buckets adds another problem, because a real portfolio rarely wants only all-in or all-out.
Direct, or recurrent, reinforcement learning skips the middle step. The agent outputs a real-valued position, such as 0.4 of capital long or 0.2 short, and updates its weights straight from the reward. Moody and colleagues showed that a differential form of the Sharpe ratio can be updated one period at a time, so the agent learns online as each new bar arrives.
The reward carries most of the weight in this setup. Rewarding raw profit teaches an agent to take large bets that happen to pay off in the training window. Penalizing volatility through a differential Sharpe or downside deviation objective pushes behavior toward steadier returns, which is usually what a real investor wants.
Take an agent that moves between minus one and plus one times its capital. Over one week it captures a 2 percent gain, but along the way it sits through a 3 percent drawdown. A raw-profit reward scores that week as pure success, while a risk-adjusted reward scores it more modestly and nudges the agent toward smaller swings next time.
A common mistake is treating a strong backtest Sharpe ratio as proof of an edge. Learning systems are very good at finding patterns that worked in the training window, including accidental ones. Out-of-sample testing across different market regimes, with realistic costs included, is the check that matters most.
Where Gradients Vanish and How LSTM Cells Hold On
Training a recurrent agent means unrolling the network through time and pushing error signals backward, a procedure called backpropagation through time. Each step in that chain multiplies the gradient by a derivative. Sigmoid activations never exceed a slope of 0.25, so fifty sigmoid steps can shrink a gradient by a factor of 0.25 raised to the fiftieth power, roughly 8 times 10 to the minus 31.
That is the vanishing gradient problem, and trading models feel it sharply. A regime shift from six months back has to survive a long chain of multiplications before it can adjust the weights. A plain recurrent network mostly forgets the lesson before it arrives.
Long Short Term Memory cells address this with gates. The forget gate decides what to discard from the cell state, and the input gate decides what new information to write. Because the cell state updates in a nearly additive way, gradients travel through it with far less shrinkage, which lets the network hold a signal for dozens of steps or more.
Dropout adds a different kind of protection. Randomly switching off a fraction of units during training, often between 20 and 50 percent, discourages the network from leaning on a few fragile pathways. For a trader, that lowers the chance that the model memorizes noise from one historical stretch.
Deng and colleagues used deep feature learning to initialize recurrent layers and optimized for maximum return, which showed that architecture and objective can be tuned together. Evolution strategies offer another route. They perturb the parameters, keep the variants that score better, and never compute a gradient, which helps when the objective is noisy or awkward to differentiate. Deeper is not automatically better, though. More parameters fit to a few years of daily data invite overfitting, and validation discipline matters more than architecture.
Pointing a Learned Agent at Banks, Bonds, and Quality Stocks
Most published tests run agents on one currency pair or one index, so a mixed sleeve raises new questions. Citigroup (C), Morgan Stanley (MS), and Goldman Sachs (GS) have earnings tied to trading revenue, deal activity, and interest rate spreads. An agent trading any of them is, in effect, betting on capital markets activity.
The iShares TIPS Bond ETF (TIP) holds Treasury Inflation-Protected Securities, whose principal adjusts with the consumer price index. A learned agent can treat TIP as a lower-volatility anchor, or rotate into it when inflation expectations jump. The iShares MSCI USA Quality Factor ETF (QUAL) tilts toward companies with high return on equity, stable earnings, and modest leverage.
Concentration is the obvious risk. Three financial names plus a rate-sensitive bond fund can all react to the same central bank decision. Bank stocks also gap on regulatory news or stress test results, and a model trained on calm years may read those gaps as noise. Quality exposure can lag too, since speculative rallies often lift weaker balance sheets and leave a quality tilt behind.
The mix does give the agent real choices. Equities, inflation-linked bonds, and a quality tilt have different volatility and correlation profiles, so a risk-adjusted reward has something meaningful to optimize. A model that learns when to lean into banks and when to step toward TIP could smooth returns without surrendering all the upside, but only if it spots trouble before the trouble lands.
Consider an illustrative $100,000 sleeve split 40 percent across C, MS, and GS, 30 percent in QUAL, and 30 percent in TIP. A calm year that lifts financials 18 percent, QUAL 12 percent, and TIP 4 percent returns about 12 percent, or $12,000. A rate shock that cuts financials 30 percent and QUAL 10 percent while adding 2 percent to TIP costs 14.4 percent, but rotating 20 points from banks into TIP beforehand would have held the loss to 8 percent.
Turning a Trained Agent Into a Live Process
Walk-forward testing trains on one window, tests on the next unseen window, then rolls forward. A single train-test split can flatter a model that happened to fit one lucky stretch. Rolling the window forward shows whether the behavior survives changing volatility.
Trading frequency matters more than many builders expect. Suppose the agent trades 500 times a year and each trade costs 2 basis points. That adds up to 10 percent of capital per year, which can erase an edge that looked healthy before costs. Model transaction costs explicitly, and model them pessimistically.
Watch for drift once the agent is live. Track hit rate, realized volatility, and average position size against the training period. When live statistics leave a set band, retrain or cut position sizes. Retraining every week sounds responsive, but it can chase noise, so set the cadence from test results rather than instinct.
Data errors cause more damage than most modeling mistakes. Survivorship bias creeps in when a stock universe uses today's index members instead of the members at each historical date. Citigroup's history shows the trap: it executed a 1-for-10 reverse split in 2011, so unadjusted prices show a tenfold jump that a model could misread as a signal. Look-ahead bias is the other common error, where a feature uses a bar's closing price to make a decision that should have happened earlier in that bar.
Many learned agents flip positions often, which compounds costs. A hysteresis rule helps: only trade when the target position moves by more than a set threshold, such as 10 percentage points. That reduces churn and keeps the agent from reacting to every small wobble in the signal.
What to Do Before Trusting a Learning Agent With Capital
Direct recurrent reinforcement learning outputs positions, and the reward function shapes how those positions behave. LSTM cells help the model carry information across long sequences. The hard problems sit in reward design, cost modeling, drift, and data quality, and none of them disappear because the architecture looks sophisticated.
Start with a short list of checks that any agent should pass before it touches real money:
1. Benchmark first. Compare the agent against buy-and-hold and a simple moving-average rule on the same data, with costs included. 2. Test across regimes. Walk forward through at least one high-volatility period and one calm period before believing any result. 3. Paper trade for a full quarter, logging every decision and comparing live fills with the fills the backtest assumed. 4. Size small and set a kill switch, such as halting trading after a 10 percent drawdown from peak equity. 5. Review each retrained model against the frozen benchmark, and keep the older version available for comparison.
Treat the agent as a hypothesis that has to survive new data. Each out-of-sample window it passes adds evidence, and each window it fails shows where the reward or the costs were wrong.