Submission type
Coded Agent with UiPath SDK
Name
Russel Alfeche
Industry category in which use case would best fit in (Select up to 2 industries)
Banking
Banking and financial services
Compliance
Finance
Other sector
Complexity level
Advanced
Summary (abstract)
STONKS is a specialist coded agentic automation built using the UiPath LangChain SDK that autonomously analyzes stocks, evaluates trade or investment decisions, and simulates trade outcomes - all within an explainable, traceable agent graph.
It functions as both a Trading Expert and an Investment Specialist, reasoning through real financial data and literature-based principles from the Complete Guide to Trading and Investing.
STONKS combines reasoning, compliance, and simulation in one continuous agentic pipeline - designed to provide financial professionals with transparent, data-driven insights and fully auditable agent decisions through UiPath Orchestrator and Langgraph.
Detailed problem statement
Investors and traders often face information overload - financial data, news, and fundamentals must be analyzed, interpreted, and translated into actionable insights in real time.
Additionally, most existing trading automations are execution bots, not thinking agents. They lack the ability to reason, apply trading literature, or justify decisions.
Financial analysts spend hours reconciling data, checking compliance, and documenting trade rationales manually. This leads to inefficiencies, missed opportunities, and inconsistent decision quality.
Hence, there’s a clear need for an autonomous, explainable coded agent that can:
• Analyze stocks contextually (trading vs investing lens)
• Apply literature-backed reasoning
• Use real-time financial data through APIs
• Simulate outcomes for validation
• Log explainable outputs within the UiPath ecosystem
Detailed solution
1. Trade & Investment Analysis Agent
This core reasoning agent analyzes financial queries through two intelligent modes:
• Investor Relations Mode – Focused on long-term investment rationale, valuation, and risk assessment.
• Trading Expert Mode – Provides tactical entry/exit levels, stop-loss, and target guidance using technical analysis principles and API data.
Core Inputs:
User query, trade date, and capital allocation.
Core Capabilities:
• Leverages financial APIs (financialdatasets.ai, polygon, twelvedata.com, etc) for real-time fundamentals, prices, and news.
• Dynamically adjusts data window and candle interval based on trade type (day, swing, or long-term/leaps).
• Applies Complete Guide to Trading and Investing literature for strategy validation.
• Outputs structured JSON results differentiating investment vs trading contexts.
Sample Output (Trading Mode):
{
“query_type”: “trading”,
“trading_response”: {
“analysis”: “Based on the 15-min trend and RSI divergence, Tesla shows a short-term overbought condition.”,
“instrument_type”: “STOCKS”,
“symbol”: “TSLA”,
“action_recommendation”: “SELL”,
“entry_price”: 254.20,
“stop_loss”: 261.50,
“target_price”: 239.80,
“entry_time_date”: “2025-10-25”,
“quantity”: 3
}
}
This ensures standardized, transparent, and easily automatable decision data across UiPath workflows.
2. Trade Exit Simulation Agent
Once a trade recommendation is generated, this agent autonomously simulates the trade’s lifecycle using historical price data.
It determines whether a trade would have hit its target, stop loss, or required a timed exit - and computes P/L and R-multiple.
Core Features:
• Fetches price data via get_stock_prices tool using 15-minute intervals.
• Calculates real trade exits based on historical performance.
• Logs both entry and exit events with reason codes (Target Hit, Stop Loss, Timed Exit).
• Returns structured JSON outputs for downstream UiPath automation or dashboarding.
Sample Output (Simulated Exit):
{
“entry_trade”: {
“date”: “2025-10-20”,
“price”: 254.2,
“side”: “BUY”,
“quantity”: 3,
“symbol”: “TSLA”
},
“exit_trade”: {
“date”: “2025-10-23”,
“price”: 261.8,
“side”: “SELL”,
“quantity”: 3,
“symbol”: “TSLA”
},
“exit_reason”: “Target Hit”,
“r_multiple”: 1.23,
“profit_loss”: 22.8
}
This layer ensures agentic accountability, converting reasoning into measurable results — bridging analysis with outcome validation.
UiPath Integration
• UiPath LangChain SDK, Agent Builder / Maestro – For agent orchestration, graph and tool routing.
• UiPath Orchestrator - For trace logging, run history, and explainability.
• UiPath Context Grounding - Vector database index for agent trading/investing literatrue knowledge
Together, these form a closed-loop automation system that spans from reasoning → simulation → audit trail.
Narrated video link
Expected impact of this automation
UiPath products used (select up to 4 items)
UiPath Agent Builder
UiPath Automation Ops
UiPath Coded Agents
Integration with external technologies
Polygon, Twelvedata, NewsAPI, Financial Datasets
