AI Trading Agents Explained: How They Actually Work
The five layers inside every serious AI trading agent — perception, reasoning, tools, memory, guardrails — traced through one complete decision cycle.

An AI trading agent is easy to demo and hard to trust. The demo shows a chat window and a filled order; it skips the part you actually need to understand, which is everything that sits between a market tick and an executed trade. This article opens the box. You will see the five layers every serious agent is built from — perception, reasoning, tools, memory, and guardrails — and then follow one real decision cycle from a closing candle to a routed order. Once you can trace that path, you can judge any agent product on its plumbing instead of its promises.
The anatomy of an AI trading agent: five layers
Strip away the interface and every agent that survives contact with a live market is the same machine. (If you want the category definition and where agents fit among bots and chat assistants, start with what agentic trading is; this piece assumes that and goes straight to mechanics.)
| Layer | Its job | What breaks without it |
|---|---|---|
| Perception | Turn market data, indicators, and news into events worth evaluating | The agent acts on stale or missing data |
| Reasoning | Decide whether the current state matches your strategy | Conditions fire literally, context gets ignored |
| Tools | The short list of actions it may take: fetch data, set alerts, place orders | Decisions happen, but nothing safe or useful follows |
| Memory | Positions, past signals, cooldowns, your stated intent | It buys the same dip five times in a row |
| Guardrails | Hard limits checked at the moment of execution | One bad decision becomes an account-level event |
The layers are kept separate on purpose. A separable system is a testable system: you can verify the indicator math without touching the order logic, and you can audit last Tuesday's veto without rereading a prompt. Research systems push this further by splitting the reasoning layer itself into debating specialist roles; that pattern has its own trade-offs, covered in multi-agent trading systems. For a personal portfolio, one agent with five clean layers is the realistic architecture.
Perception: what the agent actually sees
An agent does not watch charts. It subscribes to events. A 4-hour candle closes. A price crosses a level you named. A scheduled time arrives. A news item gets scored as relevant to a holding. Between events, a well-built agent does nothing, which is cheaper and less error-prone than constant polling.
The inputs behind those events come in four kinds. First, raw market data: candles, last prices, sometimes order-book depth. Second, derived indicators such as RSI(14), MACD, or a 200-day moving average, computed by a deterministic engine from the raw data rather than estimated by a language model. Third, external context: macro calendar entries, news flow, sentiment scores. Fourth, the agent's own portfolio state, because "buy more" means something different when you already hold a full position.
Evaluation frequency is a real design decision, not a detail. An agent that evaluates on each 4-hour close will trade a handful of times a month; the same rules checked every minute will fire on noise, rack up fees, and whipsaw. When you define a strategy, you are also defining its clock.
Data hygiene is the unglamorous half of perception. Exchange APIs stall, feeds lag, candles arrive late. The correct default when data is missing or stale is inaction: skip the evaluation, log the gap, wait for the next event. An agent that fills gaps by assumption is not perceiving the market; it is imagining one.
The reasoning layer: rules, LLMs, or a hybrid
Three designs compete here, and the honest comparison is short. Pure rules are deterministic, fast, and testable, but they cannot read a headline or parse your intent. A pure LLM can do both, yet it is expensive per decision and unreliable with numbers; one 2024 study of financial question-answering measured hallucination rates of up to roughly 41% without safeguards (FailSafeQA and related benchmarks, 2024). Neither extreme wins. The architecture that does is a hybrid: language model at the edges, deterministic engine in the middle.
Here is the part most explainers miss. In a good hybrid, the LLM reasons about your words once, not about every tick. Take "buy the dip," a phrase with no numeric definition. The reasoning layer's real work happens at build time: converting that intent into a precise predicate such as "RSI(14) on the 4-hour chart closes below 30 while price holds above the 200-day moving average." From then on, each evaluation is arithmetic a rules engine performs in microseconds. The model that interpreted your sentence never touches live order math.
This is exactly how Obside splits the job: the copilot translates plain language into monitored conditions and restates them for your approval, then hands the running strategy to deterministic evaluation. Where you draw the line between language tasks and numeric tasks decides most of an agent's reliability; the full capability map is in what LLMs can and can't do in trading.
Some agents also consult a model at run time for genuinely linguistic events, like classifying whether a headline is material to a specific holding. That is a defensible use, provided the model's output feeds a rule ("pause buying if severity is high") rather than sizing an order directly.
Tools, memory, and the guardrail layer
An agent's power is defined by its tool list, not its intelligence. Tools are typed function calls with narrow signatures: fetch candles, compute an indicator, send an alert, place or cancel an order, move a stop. The constraint is the feature. An agent whose only order tool is place_order(symbol, side, size, type) cannot withdraw funds, change account settings, or invent an action no matter what its reasoning concludes. When you evaluate a platform, the sharpest question is not what the agent can do but what it provably cannot.
Memory is what separates an agent from a stateless trigger. It holds current positions, open orders, which signals fired this week, and cooldown timers. Consider the failure it prevents: a dip-buying rule with no state will fire on every consecutive 4-hour candle while RSI sits below 30, turning one planned entry into six. The instruction "at most twice a week" lives nowhere except memory.
Guardrails are the last layer an order crosses, and their defining property is placement: they run at execution time, outside the reasoning layer, as a veto rather than a suggestion. Position size caps, per-agent exposure limits, fixed and trailing stops, drawdown circuit breakers, leverage limits. Even a confused reasoning layer cannot exceed them. Sizing each one properly is its own discipline, laid out in guardrails for AI trading agents.
One full decision cycle, end to end
Time to run the machine. The strategy, as a user would state it: "Buy $150 of ETH when RSI(14) on the 4-hour chart closes below 30 while price is above the 200-day moving average, at most twice a week, with an 8% trailing stop." On Obside you would type that sentence into the copilot, which restates what it parsed — asset and venue, indicator with timeframe and threshold, trend filter, order size, weekly cap, stop type — and waits for your approval before anything runs. That restatement is the reasoning layer doing its once-per-strategy job in the open.
Now a Thursday, 04:00 UTC:
- Perception. The 4-hour candle closes. The event fires; the engine computes RSI(14) at 27.6 from the closed candles.
- Reasoning. Condition one holds (27.6 is below 30). Condition two is checked against fresh data: price sits about 4% above the 200-day moving average. Both true.
- Memory. One buy already executed this week, on Tuesday. The cap is two, so the entry is permitted, and this evaluation is recorded either way.
- Guardrails. The proposed $150 order is checked against the position size cap and the portfolio exposure limit; the drawdown breaker is untripped. Pass.
- Tools.
place_ordergoes out; on the fill, an 8% trailing stop is attached. Every step lands in the log with its inputs.
Compare Friday, 20:00 UTC: the candle closes with RSI at 26.9, the trend filter still holds, and the agent does nothing, because memory shows two buys already this week. It logs the veto and the reason. Doing nothing with a reason attached is most of what a good agent does. Note also that no language model was consulted in either cycle. The thinking happened when the strategy was written; the cycles are execution.
On Obside the five layers wear product names. Triggers on price, indicators, news, and macro events are the perception layer. The copilot's translation and restatement is the reasoning step. Order routing with risk checks applied at execution time covers tools and guardrails, and each agent carries its own state. The same agent definition runs unchanged through backtest, paper trading, and live execution, so the machine you audited is the machine that trades.
Where to go from here
You now hold a working audit checklist for any AI trading agent. What events does it perceive, and on what clock? When exactly is the LLM consulted, and is it ever allowed to do arithmetic? What is the complete tool list? What state does it keep between evaluations? What can veto an order after reasoning approves it? A vendor who can answer all five crisply has built the machine described here. A vendor who answers with adjectives has built a demo. If you want to see the five layers assembled and inspectable in one place, describe a strategy in a single sentence on Obside and watch it come back to you as conditions, sizes, and limits you approve before anything runs.
Educational content only. This is not investment advice. Trading involves risk, including possible loss of capital.
FAQ
Through a layered cycle rather than a single model call. Perception turns market data into events, a reasoning layer checks whether your strategy's conditions hold, memory enforces frequency and position awareness, and guardrails run a final veto before any order tool is called. In well-built agents the language model interprets your strategy once, at creation time, while live decisions are deterministic checks against precise conditions.