Agentic tradingRiskBeginnersMCP

How to build a news-driven trading agent when you have never automated a trade

How to build a news-driven trading agent with LLMs. Checklist covers data feeds, hard limits, non-custodial execution, and paper trading before live capital.

By the Felix team8 min read
Key takeaways
  • 01A news-driven agent should never browse the open web; it needs a curated, structured feed to avoid noise and hallucinated sources.
  • 02The LLM proposes trades, but hard limits on budget, position size, and withdrawals are enforced by the infrastructure, not the model.
  • 03Position sizing must be based on fixed dollar rules, not on the LLM's confidence score, which measures linguistic coherence, not probability of profit.
  • 04Paper trading is mandatory: run the full loop for days, test the kill switch, and inject worst-case headlines before authorizing live capital.
  • 05Trading can lose money, including everything, so the first live budget should be an amount you can afford to lose entirely without changing your life.

A news-driven trading agent reads headlines or structured data, scores their likely market impact, and places orders through an API. You do not need prior automation experience to build one, but you do need to wire the LLM to a data feed, define hard limits it cannot override, and test in paper mode before authorizing live capital. The checklist below assumes you are starting from zero automated trades and want to minimize the chance of expensive mistakes. Every step focuses on safety first, because an agent that reacts to headlines can move quickly in the wrong direction if its guardrails are loose.

What does a news-driven trading agent actually do?

A news-driven agent does not need to predict tomorrow's price. Its job is to read a curated stream of headlines, earnings releases, or macro alerts, map them to specific markets, and apply a fixed set of rules you wrote in the prompt. The LLM is the reasoning layer, not the portfolio manager. It might classify a headline as bearish for a single stock, neutral for a sector, or relevant to a commodity on a perps venue. Once the LLM emits a signal, a separate execution layer translates that into a concrete order sized in plain US dollars and routes it through an API. The agent never holds your funds in its own wallet. In a non-custodial setup, the capital sits in an account or wallet you control, and the agent can only spend within limits you set in advance. If you are new to this model, what is agentic trading explains the architecture in more detail. The key point is that the LLM proposes, but the safety layer disposes. You should also decide in advance which markets the agent is allowed to touch. An agent authorized for stocks, crypto, and prediction markets might receive a headline that affects all three, and your prompt must specify whether it should pick one, trade all, or do nothing. Ambiguity is dangerous because the LLM will guess, and guesses are not a strategy.

How do you connect the agent to news without giving it unlimited access?

Do not let the agent browse the open web. Unsupervised browsing introduces noise, latency, and hallucinated sources. Instead, pipe a curated feed directly into the agent through an API, webhook, or RSS parser. The feed should emit structured fields you define: headline text, timestamp, ticker or market identifier, and a source category. The agent should receive exactly those fields and nothing else. If you use webhooks, configure the sender to post only the symbols your agent is allowed to trade. This prevents a headline about a private company from leaking into a prompt that might trigger an order on a similarly named public stock. Latency matters. A headline that moves a prediction market in seconds is useless if your agent reads it five minutes later. Test the pipeline end to end and measure the gap between publication and order submission. If the gap is too large, the agent is not trading news, it is trading history. You should also validate ticker mappings. Suppose a headline mentions a consumer electronics firm in the context of a lawsuit about a grocery store, not the technology company. Your prompt should require the LLM to verify the ticker mapping and context before it treats the headline as a signal. A simple rule like only act if the headline explicitly names the ticker and the sector can prevent many false positives. Keep the data layer dumb and the reasoning layer strict. Finally, decide how the agent handles duplicate headlines. If a feed rebroadcasts the same story three times, the agent might triple its intended exposure unless you deduplicate by headline hash or timestamp window.

What guardrails should you set before the agent sees any price?

Guardrails are not an afterthought. They are the foundation. Before the agent receives its first headline, configure scoped API keys, budget caps, position limits, and a kill switch. A scoped key grants the agent permission to create orders but not to withdraw funds or change account settings. Budget caps define the maximum US dollars the agent can deploy in a day, week, or month. Position limits prevent any single trade from exceeding a fixed dollar amount or percentage of the total budget. The kill switch is an owner-controlled panic button that flattens all positions and revokes the agent's key immediately. In Felix, withdrawal addresses are owner-approved only, so the agent can spend within limits but it can never send money to itself. These controls are enforced by the infrastructure, not by the LLM, which means the agent cannot talk its way around them. You can trade every market through one API with hard limits the agent cannot cross, regardless of how compelling a headline appears. You should also set an exit plan. Define the conditions under which the agent must close a position: a time limit, a loss threshold, or a contrary headline. Write these rules into the prompt, but also enforce them at the API level where possible. An LLM might forget a rule under pressure; a hard limit does not forget. If you are unsure whether your limits are tight enough, start with a daily budget you could lose entirely without changing your life. That is the correct amount for a first agent.

How do you translate a headline into a position size?

The LLM should reason about direction and relevance, but it should not choose the dollar amount. Position sizing belongs to a separate layer that converts the LLM's signal into a concrete order within your hard constraints. On Felix, orders are sized in plain US dollars, so you do not need to calculate contract multipliers or margin ratios. You define a rule such as commit at most one hundred dollars to any single headline signal or never exceed five percent of the daily budget on one position. The API normalizes the math across stocks, crypto, perps, options, and prediction markets. Imagine the agent reads a headline about a supply disruption. It might infer bullish pressure on a commodity. If your rule says commit at most one percent of the daily budget to any single headline, the API blocks an order that exceeds that dollar threshold even if the LLM is confident. Do not size trades based on LLM confidence scores. A language model's certainty is not a probability of profit. It is a measure of linguistic coherence. A confident hallucination can lose money just as fast as a confident truth. For a step by step approach to this layer, see how to size positions for an AI trading agent. The safest first approach is fixed fractional sizing: every valid signal gets the same small dollar amount, regardless of the headline's drama.

How do you test the full loop without risking capital?

Paper trading lets you run the agent against live market data without committing real money. You should treat the paper phase as mandatory, not optional. Connect the data feed, activate the agent, and let it trade for several days. Watch for three things: whether it misreads headlines, whether it respects the hard limits, and whether the kill switch actually flattens positions when you press it. Log every decision. If the agent buys a stock on a headline that was actually about a different company, your prompt is too vague. If the agent attempts an oversized order and the API rejects it, your sizing layer is working. If the kill switch fails, do not go live. You should also simulate a worst-case scenario. Manually inject a headline that implies extreme volatility and verify that the agent either trades within its micro budget or stays flat according to your rules. Before you authorize live trading, audit your trading agent guardrails to confirm they behave as expected. Paper trading is only useful if you are honest about the results. Ignoring a mistake because it did not cost money is how you guarantee it will cost money later.

What is the exact sequence to go live?

Going live should be boring. If it feels exciting, you are doing it wrong. The sequence is: write the prompt and constraints, connect to paper trading, run for a defined observation period, audit the logs, authorize a live key with the smallest budget you can afford to lose, and monitor the first trades manually. Do not authorize a large budget on day one. The purpose of the first live trades is to confirm that real money behaves the same as paper money, not to make a profit. Keep the kill switch within reach during the first sessions. If the agent deviates from its prompt, flattens everything, revokes the key, and debugs on paper again. You should also review the agent's activity daily for the first two weeks. An unattended agent is a liability. Trading can lose money, including everything, and headlines can move markets against you faster than you can intervene. The only way to survive your first automation is to assume something will break and to build your limits so that the breakage is survivable. When you do increase the budget, do it in small steps separated by review periods, not in a single leap.

Frequently asked questions

Do I need to know how to code to run a news-driven trading agent?

No. You can connect an agent through MCP tools in Claude, Cursor, or other MCP clients by describing the strategy in natural language. The platform handles the execution layer. You only need to define the rules, the limits, and the data feed.

Can the agent trade all five market types from the same prompt?

Yes, but you should probably start with one. Each market type has different volatility profiles and settlement mechanics. A prompt that works for stocks may be dangerous if applied blindly to leveraged perps or binary prediction markets.

What happens if the LLM misinterprets a headline?

The order still routes to the API, but the position limit and budget cap will constrain the damage. If you catch the pattern in paper trading, you tighten the prompt before going live. If it happens live, you hit the kill switch and revise.

How fast does the agent need to be to trade news?

That depends on the market. A headline that affects a stock may take minutes to price in, while a prediction market can move in seconds. Measure your pipeline latency during paper trading and only trade markets where your speed is competitive.

Can I run multiple agents on the same account?

You can, but each should have its own scoped key and budget partition. Sharing keys or budgets makes it impossible to tell which agent caused a loss and breaks the kill switch logic.

Is paper trading identical to live trading?

The market data is identical, but slippage and liquidity may differ. Paper fills assume a perfect book. Live orders can partial fill or move the price, especially in thin markets. Start with small size to discover these differences.

Give your agent a key.

One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.