Inspiration
The world of algorithmic trading offers immense potential, but it's often locked behind a steep learning curve of complex programming. Most traders have unique market insights and brilliant ideas, but lack the coding skills to translate them into automated strategies. We were inspired by the power of modern Large Language Models and asked a simple question: "What if any trader could turn their ideas into a fully automated strategy, simply by describing it in plain English?" Our inspiration was to build an AI agent that acts as a bridge, democratizing access to algorithmic trading and empowering users to build, test, and optimize their strategies conversationally.
What it does
- NexusTrader is an AI-powered co-pilot for traders, seamlessly integrated into the cTrader platform as a WebView plugin. It's not just a code generator; it's a complete, end-to-end system that manages a full, intelligent feedback loop:
- Idea to Execution: A user describes a strategy in natural language (e.g., "Buy EURUSD when the RSI is below 30, with a 50 pip take profit"). The AI agent, powered by Amazon Bedrock, translates this into a structured, executable plan and activates it.
- Autonomous Tracking: A background engine continuously monitors market conditions, simulates trade executions for active strategies, and records performance data (P&L, wins, losses) directly into a DynamoDB database.
- Proactive Analysis & Coaching: The agent proactively identifies underperforming strategies based on predefined rules. It then fetches live market news for context and uses its analytical abilities to generate a list of concrete, data-driven suggestions for how to improve the strategy.
- One-Click Optimization: The user can review these AI-generated suggestions in a dedicated "Coach" tab and apply a new set of rules with a single click. The system can even be configured to auto-rotate to new suggestions if performance doesn't improve, creating a truly autonomous optimization cycle.
How we built it
NexusTrader is built on a robust, scalable, and entirely serverless AWS architecture, designed to showcase a modern, event-driven AI application.
- Frontend: The user interface is a Next.js application using React, TypeScript, and Tailwind CSS. It is designed to run inside the cTrader WebView plugin, providing a seamless and native user experience.
- Backend Orchestrator: We used a Next.js API Route as the central orchestrator that communicates between the frontend and the Bedrock Agent. This keeps the architecture simple and the frontend secure.
- The AI Brain: The core of our system is an Amazon Bedrock Agent. We used a powerful foundation model (Nova Pro) to handle natural language understanding, reasoning, and tool invocation.
- Agent Memory: We used Amazon DynamoDB as the agent's persistent memory. This highly scalable NoSQL database stores all user strategies, their structured parameters, performance metrics, and AI-generated suggestions.
- Autonomous Engine: To power the continuous performance tracking, we used Amazon EventBridge to trigger our strategy Executor Lambda on a regular schedule, creating the autonomous background loop that makes our agent truly intelligent.
Challenges we ran into
Sophisticated Prompt Engineering: Moving from a simple user description to a structured, executable JSON was a major challenge. Our initial prompts were too simplistic. We had to develop a sophisticated, multi-part prompt that "teaches" the AI our exact data schema, including different types of conditions (e.g., technical indicators vs. time-based triggers), which required significant iteration.
Designing an Autonomous Loop: Creating the "self-optimizing" feature was architecturally complex. We had to design a system where the background monitoring process could not only track performance but also safely trigger the generation of new suggestions and have a cooldown mechanism to prevent spamming the user or the AI.
Stateful Conversations: An agent needs memory. Managing the conversation history and ensuring the agent could understand context from previous messages (like a user confirming an action) required careful state management between our Next.js frontend and the Bedrock Agent backend.
Accomplishments that we're proud of
The Complete Feedback Loop: We are incredibly proud that we didn't just build a feature; we built a complete, end-to-end intelligent system. The cycle of Idea -> Execution -> Tracking -> Analysis -> Optimization is fully realized and demonstrates a truly advanced AI agent.
The Proactive Coaching System: Our agent doesn't just wait for commands. The ability to autonomously identify underperforming strategies and generate data-driven suggestions is the "magic" of our application and what provides the most value to the user.
A Truly Useful AI Agent: We successfully created an agent that solves a real, difficult problem. We took a complex domain typically reserved for experts and made it accessible through a simple, conversational interface, which we believe is the future of specialized software.
What we learned
Prompt Engineering is System Design: We learned that a well-designed prompt is just as important as well-written code. Defining a strict JSON schema and providing clear examples within the prompt is the key to getting reliable, structured output from an LLM.
Serverless is Perfect for Event-Driven AI: The combination of Lambda for tools, EventBridge for triggers, and DynamoDB for state is an incredibly powerful and scalable stack for building event-driven, autonomous agents.
The Power of Agent Personas: Formally separating our agent's roles into an "Operator" (managing user requests) and an "Analyst" (providing data insights) made the entire development process much clearer and the final system more robust.
What's next for NexusTrader: The AI-Powered Automated Trading Strategist
NexusTrader has a clear and exciting roadmap ahead to evolve from a powerful hackathon project into a commercial product.
Monetization: We plan to introduce a tiered subscription model (Basic, Premium, Pro) that offers varying levels of features, such as the number of active strategies, the frequency of AI analysis, and access to advanced analytics.
Admin Panel: A comprehensive dashboard for administrators to manage users, monitor system health, oversee global strategy performance, and fine-tune AI model configurations.
Expanded Strategy Support: Enhance the AI's understanding to support more complex strategy types, including those based on price action (e.g., "yesterday's high/low"), fundamental analysis (e.g., news events), and multi-indicator conditions.
Multi-Broker Support: Abstract the execution layer to allow integration with other popular trading platforms and brokers beyond cTrader.
Built With
- amazon-bedrock
- amazon-dynamodb
- amazon-eventbridge
- amazon-web-services
- amazon-web-services-(aws)
- aws-lambda
- ctrader
- next.js
- node.js
- react
- tailwind-css
- typescript
Log in or sign up for Devpost to join the conversation.