Agentic tradingDevelopersNews tradingRisk

How to build a news-driven trading agent with zero automation experience

A guide to building a news-driven trading agent with an LLM from zero automation experience, emphasizing non-custodial safety and real capital risk.

By the Felix team10 min read
Key takeaways
  • 01A news-driven trading agent automates a decision loop you define in advance by reading headlines, evaluating them through an LLM prompt, and placing orders through a non-custodial API.
  • 02The LLM is a reasoning layer that follows your written policy; it is not an oracle, and its output must be validated by your code and the API's hard budget caps before any trade reaches the market.
  • 03You do not need to build a data center. A curated RSS feed or webhook, a simple keyword filter, and deduplication are enough to feed a beginner agent reliably.
  • 04Felix enforces safety by construction: scoped keys, budget caps, position limits, and a panic switch prevent the agent from withdrawing funds or exceeding the boundaries you set.
  • 05Trading can lose money, including your entire allocated budget, so you should test in paper mode, start with capital you can afford to lose, and review rationale logs regularly.

A news-driven trading agent reads headlines, evaluates whether they change the price outlook for an asset, and places orders through an API without asking for permission each time. If you have never automated a trade, you can build one by combining a news feed, a large language model, and a non-custodial trading API that enforces hard spending limits. The goal is not to replace your judgment, but to automate a repeatable decision loop that you define in advance. Trading can lose money, including the entire budget you allocate, so the agent must carry guardrails that you cannot override in the heat of a news cycle.

What does a news-driven trading agent actually do?

What the agent does is simple in concept and complex in detail. It runs a continuous loop that waits for a new headline, sends the text through an LLM prompt that encodes your strategy, and turns the model's output into an order if the output meets your criteria. You do not need to predict the future. You need to encode how you react to specific types of information. For example, you might decide ahead of time that a surprise interest rate cut makes you want to increase exposure to broad equity indices, while a regulatory warning about a specific token makes you want to reduce exposure to that token. The agent automates that exact logic. After the order reaches the API, the safety layer checks it against your scoped key permissions. If the order would exceed your budget cap or position limit, the API rejects it before it reaches the market. The agent receives the rejection and logs it. You can review these logs to see whether the agent is bumping into limits too often, which is a sign that your prompt is too aggressive or your budget is too small for the number of headlines you are processing. The Felix API normalizes the order so you do not need to learn venue-specific contract formats. You state the size in US dollars, and the API handles the translation to whatever unit a stock broker, a crypto exchange, a perps venue, an options venue, or a prediction market expects. This means your first agent can trade across all five market types without you writing different code for each. Most news-driven strategies rely on minutes or hours of reaction time, not milliseconds, which makes them accessible to first-time builders.

How do you collect and format news without a data engineering team?

You do not need a dedicated data engineering team to feed the agent. Start with an RSS feed, a webhook from a news aggregator, or a lightweight script that calls a public headline API every few minutes. The only requirement is that you produce a clean text object containing the headline, a timestamp, and perhaps a category tag. Strip everything else. HTML, advertisements, and navigation boilerplate will confuse the LLM and waste context window. You can add a simple keyword filter before the LLM stage. If the headline does not contain any of your trigger words, discard it. This saves API costs and reduces noise. The LLM should only see headlines that have already passed a coarse filter. Feed hygiene matters more than volume. A noisy stream will cause the agent to overtrade, racking up fees and hitting budget limits for no reason. Curate five to ten sources that are directly relevant to the assets you watch. Pass the headline and a one-sentence summary to the LLM. If you must include the full article, truncate it to the first two paragraphs. The LLM rarely needs more than that to classify the event. Deduplicate headlines by storing a hash of the text and ignore duplicates within a day. If your source supports webhooks, push headlines directly to your agent as they arrive. If you poll, use a cron job or a simple loop with a sleep timer. News trading rarely requires millisecond precision, but it does require consistency. A missed headline because your script crashed is a broken strategy, not a slow one. Monitor the feed uptime as carefully as you monitor the trading budget.

How does the LLM turn headlines into trade decisions?

The LLM is not an oracle. It is a reasoning layer that follows a policy you write inside the system prompt. You should write the prompt as if you are instructing a junior analyst who has no market experience. Be explicit about keywords, asset mappings, and dollar limits. For example, your prompt might state: 'You manage a $1,000 budget across stocks and crypto. If a headline contains the phrase 'rate cut' and mentions a central bank, you may consider a long position in a broad index ETF up to $100. If a headline contains 'security breach' and names a specific crypto project, you may consider reducing exposure to that project by up to $50. Otherwise, do nothing. Always respect the remaining budget and never exceed $100 per position.' Ask the LLM to return structured output, such as a JSON object with fields for action, symbol, usd_size, and rationale. Set the temperature to zero or a low value so the output is deterministic for identical headlines. Require the LLM to include a one-sentence rationale for every decision. This log becomes your audit trail. When a trade loses money, you can read the rationale to see if the LLM misunderstood the headline or if your policy was ambiguous. Your code should parse that JSON and validate every field before it touches the trading API. Never let the LLM generate raw API requests. Never let it choose a symbol that is outside your allowlist. Never let it set a size that exceeds the per-trade cap you hardcode in your script. The safety model is layered for a reason. The LLM can misread sarcasm, trust a false source, or hallucinate a ticker. Your parser catches malformed JSON. Your code enforces the symbol allowlist and size limits. The API enforces the ultimate budget ceiling and position limits. How the safety model behind LLM trading works describes this stack in detail. Budget caps are non-negotiable. How an AI agent trades within a hard budget it cannot exceed explains why the agent cannot borrow against your wallet or exceed the allocation you set.

How do you connect the agent to markets without giving up custody?

Felix is non-custodial by construction. Your funds remain in a wallet that you control. The agent receives a scoped key that can place orders and manage positions, but it cannot withdraw funds to itself or any external address. Withdrawal addresses are owner-approved only. If the agent is compromised, the attacker can only lose what the budget cap allows, and you can revoke the key instantly. You can connect the agent through MCP tools or the REST API. If you use Claude, Cursor, or another MCP client, you can set up an MCP server that exposes trading tools to the LLM. The MCP server holds the scoped key and enforces the limits you configure. An MCP connection lets the LLM discover available tools through a standard interface. You define the tool descriptions, and the LLM decides when to call them based on the headline analysis. The MCP server still enforces the scoped key limits, so the LLM cannot bypass the budget even if it tries. A simple script can also call the REST API directly, using the same safety controls. The exact request schema is in the docs; the shape looks like this:

{
  "symbol": "EXAMPLE",
  "usd_size": 100,
  "side": "buy",
  "market_type": "stocks"
}

Orders are sized in plain US dollars. The API normalizes the translation to whatever unit a stock broker, a perps venue, an options venue, or a prediction market requires. You do not need to calculate lot sizes, decimal precision, or notional adjustments. This removes a common source of errors for developers who have never placed an automated order before. If you prefer an MCP setup, how to run a trading agent from Claude using MCP walks through the configuration. If you want to trigger trades from external news services via HTTP callbacks, how to automate trading agents with webhooks without losing custody covers the webhook path.

How do you handle headlines that move multiple markets?

Some headlines affect more than one asset. A central bank announcement might move currency, equity, and bond markets simultaneously. Your agent needs a priority rule to avoid conflicting orders. Decide in your prompt which asset takes precedence, or instruct the agent to spread the risk across multiple markets with a fixed sub-budget for each. Because Felix uses one API for stocks, crypto, perps, options, and prediction markets, you can send correlated orders to different venues without managing separate integrations. The API normalizes each order into the correct format for the target market. You still need to think about correlation risk. A headline that causes you to buy an index and sell a single stock might create unintended exposure if the stock is a large component of that index. Your prompt should state how to handle correlated assets. For example, you might say: 'If the headline affects both a sector and a specific stock within that sector, trade only the specific stock and ignore the sector ETF.' This prevents double counting and keeps your position count low. Fewer positions are easier to monitor and faster to flatten in an emergency.

What should you verify before switching from paper to live trading?

Paper trading exists so you can test the entire loop without risking capital. You should run the agent in paper mode for several sessions, feeding it real historical headlines and observing what it would have done. Do not optimize for one lucky headline. Look for repeated mistakes, such as trading on rumors from untrusted sources, misinterpreting negation, or acting on duplicate headlines. Use a short checklist before you authorize a live key: - Confirm that the budget cap is enforced in paper mode. - Verify that the kill switch flattens all positions and revokes the key. - Test malformed LLM output to ensure your parser rejects it. - Check that your news feed is stable and does not duplicate headlines. - Review the panic switch manually during a scheduled test. Only after paper results show the agent respects your rules should you enable live trading. Live trading requires explicit owner authorization of the key. Start with a small budget that you can afford to lose entirely.

How do you stay in control when the agent is running?

Set an exit plan before the first trade. Define a maximum holding period, a maximum loss per trade, and a daily loss limit. The API can enforce some of these boundaries, and your code should enforce the rest. Define a take-profit level or a time-based exit for every position the agent opens. The API can automate these exits so the agent does not need to watch the market continuously. This removes the risk that the agent holds a position indefinitely while waiting for the next headline. Schedule a manual review at a regular interval, perhaps daily or weekly, to read the agent's rationale logs and verify that it is still following your prompt. The panic switch is essential. If a headline causes a market crash or a feed glitch spams the agent with duplicate alerts, you need a single command that flattens all positions and revokes the scoped key. Test this during paper trading. The agent should not be able to disable its own kill switch. You can pause the agent at any time by revoking the scoped key or by stopping the script. Because the system is non-custodial, pausing does not lock your funds, and you can trade manually through the same API if you need to intervene. Remember that trading can lose money, including the entire amount you allocate. The agent is not a source of income. It is a tool for executing a strategy with discipline. If the strategy is flawed, the agent will execute the flaw faster than you can manually. Maintain a log of every headline and every decision for post-trade review. Over time, you can refine the prompt, but never refine it to chase past performance.

Frequently asked questions

Can I build a news-driven agent if I have never written a trading bot?

Yes. You need three components: a news feed, a prompt that encodes your strategy, and a non-custodial API that enforces spending limits. The Felix API normalizes orders across all five market types, so you do not need to learn venue-specific formats.

How does the agent know which headlines to trade?

You define the rules in the system prompt. The LLM classifies the headline and returns a structured decision, but your code validates the output against an allowlist of symbols and a hard budget cap before any order is sent.

What happens if the agent misinterprets a headline?

The layered safety model catches errors at multiple stages. Your parser rejects malformed output, your code enforces size limits, and the API rejects orders that exceed the budget or position caps. You can also flatten all positions instantly with the panic switch.

Do I need to give the agent custody of my funds?

No. Felix is non-custodial by construction. Your funds stay in a wallet you control, and the agent uses a scoped key that cannot withdraw funds or send them to unapproved addresses.

How much money should I allocate for my first live agent?

Start with a small budget that you can afford to lose entirely. Run the agent in paper trading first, and only authorize a live key after consistent behavior across many diverse headlines.

Can I stop the agent if the news cycle becomes too volatile?

Yes. You can revoke the scoped key or stop the script at any time. The kill switch flattens all positions and removes access immediately, and you retain full manual control of your wallet.

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.