Skip to content
Aayush Swami
Menu

Research + Engineering

Agentic trading research

Can an AI agent follow a fixed trading strategy and explain every decision?

Status
Research, phase one (paper trading only)
Stack
Python, LangGraph, OANDA practice API

The question

Most “AI trading bots” chase profit and hide their reasoning. This research project, run with a professor, asks a simpler question first: can an agent follow a clear set of strategy rules on live market data — and tell us why it took or skipped each trade?

Profit is not the goal of phase one. Understanding the agent's decisions is.

What I built (phase one)

  • A live feed of gold (XAU/USD) candles from the OANDA practice API.
  • An agent that checks each new candle against my predefined strategy conditions and decides: take the trade, or skip it.
  • A decision log: every choice is saved with the inputs the agent saw and its reason.
  • A live paper-trading dashboard to watch it happen. No real money is used.
Agentic trading, phase oneLive gold candles from the OANDA practice API flow into a market data service, then a decision agent checks the strategy rules and writes a reasoned take-or-skip entry to a decision log and a paper order to a paper broker; both feed a live dashboard.take / skip + reasonpaper orderOANDA practice APIlive XAU/USD candlesMarket data serviceDecision agentchecks strategy rulesDecision logPaper brokerLive dashboard
Fig. 1 — Live candles reach a decision agent that checks the strategy rules, then writes a reasoned take-or-skip entry to the log and a paper order to the broker; both feed the dashboard.

Phase two (planned)

Separate agents for market conditions and timing, risk, and trade placement — plus an ML model — so each part can be tested on its own.

Agentic trading, phase twoA market analysis agent, a risk management agent, and an ML signal-quality model all report to an orchestrator, which is the only component that calls the trade execution agent.Market analysis agentRisk management agentML modelsignal qualityOrchestratorTrade execution agent
Fig. 2 — Market analysis, risk management, and an ML signal-quality model all report to an orchestrator, which is the only component that places trades.

Key decisions

  • Build my own system instead of using an open-source trading-agent framework. I studied those repos and papers, but I wanted full control over how decisions are made and logged.
  • Start with one instrument (gold). High volume and one market keeps the first experiment clean. Other forex pairs come later.
  • Paper trading first. Safe, and every decision can be replayed and checked.

What I'd do next

  • Finish phase two's multi-agent split.
  • Add a replay mode that runs the agents over past data for fast testing.

All selected work