STONKS: Specialist Trading/Investing Operations with Neural Knowledge Agentic System

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

:puzzle_piece: 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.

:abacus: 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.

:gear: 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

Imgur

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

TO-BE workflow/architecture diagram (file size up to 4 MB)

Other resources

3 Likes

:waving_hand: Hi there, @zell12 builder,

Thank you so much for being part of the Specialist Coded Agent Challenge. Your creativity, dedication, and automation skills truly blew us away! :collision:

Here’s what’s next:

:spiral_calendar: Nov 5–16: Jury evaluation by @eusebiu.jecan1 & @Adrian_Tamas + community voting
:trophy: Nov 17: Winners announced :tada:

Don’t forget the Community Choice Award, the best-voted project wins a $500 gift card + $60 UiPath Swag voucher! Voting is open till Nov 16, but remember that fresh accounts can’t vote (Level 1 access required, as we want to keep it fair and spam-free).

You’ve already won our admiration, now let’s see who takes home the big prizes :grinning_face_with_smiling_eyes:.

GOOD LUCK :four_leaf_clover: ,

Loredana

1 Like