Inspiration

What inspired me to make this app is out of frustration with myself learning the ropes of trading the stock markets. Trying to overcome the constant pitfalls and mistakes one make when trading, feeling your heart race at a thousand miles an hour and all that you have learned and wrote down on pieces of scrap paper scribbled over other scribbles goes flying out the window, and leaving you to wrestle with your emotions and shaking hands not knowing what to do next in that moment just to end up losing all you worked for and leaving u with bigger scars than when you started your trading journey and heaven forbid leaving you with bigger debt than you can imagine. Ad an Elevenlabs Conversational Ai agent to the mix then you have just might have a superpowered assistant at your fingertips.

What it does

Cogni Trade is designed to be a personal trading psychology assistant, helping you navigate the emotional complexities of the markets and build disciplined trading habits. It's built around the core idea that mastering your mind is as crucial as mastering market analysis. What this tool aims to do is to help the trader take control of their emotions when they seem to hit that blank spot in their mind when sitting in front of the charts. It acts as a trading psychology platform that helps traders develop mental discipline through intelligently timed alerts that the trader can setup at the precise times they need it. The app combines time-based alerts with emotional state monitoring to prevent common trading mistakes like revenge trading and emotional decision-making. It alerts the user during their trading session what to look out for.

1. Understand and Manage Your Trading Psychology: It encourages self-awareness by prompting you to reflect on your emotional state before, during, and after trading.

2. Automate and Personalize Alerts: You can create highly customized alerts to keep you informed of market conditions or personal triggers, reducing the need for constant screen monitoring and impulsive decisions.

3. Structure Your Trading Process: By guiding you through defined trading sessions and encouraging a detailed trading plan, it helps you build consistency and adherence to your strategy.

4. Analyze Your Performance Beyond P&L: It offers deep insights into how your emotional state, adherence to your plan, and specific setups impact your profitability.

How CogniTrade Helps You Overcome Fear and Emotion The app directly addresses common psychological challenges faced by traders:

Combating Fear of Missing Out (FOMO) and Impulsivity:

1. Smart Alerts: By setting up automated alerts for specific market conditions or trading opportunities, you can reduce the urge to constantly check charts or jump into trades out of fear of missing a move. The app notifies you when your criteria are met, allowing for more rational entry.

2. Structured Sessions: The pre-session check-in helps you define your goals and acknowledge your current emotional state, making you less likely to trade impulsively.

Managing Emotional Biases (Greed, Fear, Revenge Trading):

3. Pre-Session Check-in: Before you even place a trade, you're prompted to assess your focus and nervousness levels. This self-awareness is the first step to preventing emotional trading.

4. Post-Session Review: After a session, you reflect on your emotional journey, identify what triggered certain feelings, and how well you stuck to your plan. This reflection helps you learn from emotional mistakes.

Analytics (Emotional State & Plan Adherence): The analytics section shows you how your emotional state correlates with your P&L and how adhering to your plan impacts your results. Seeing this data visually can be a powerful motivator to control emotions and stick to your strategy.

Building Discipline and Consistency:

1. Trading Plan: The "Mind Profile" section allows you to articulate your trading plan, including entry/exit criteria, position sizing, and how you handle news. This acts as a personal rulebook, making it easier to follow a disciplined approach.

2. Trade Logging: Every trade you log within a session is tied to that session's context, including your emotional state and whether you adhered to your plan. This creates a rich dataset for self-improvement.

3. Monitoring Sessions: These allow you to schedule and activate specific alert groups for defined periods, ensuring you're only exposed to relevant information during your active trading times.

Key Features and How to Use Them 1. Trading Sessions:

Start a Session: Before you begin trading, initiate a session. You'll complete a "Pre-Session Check-in" where you define your goals and assess your mental state (e.g., focused, distracted, nervous).

Log Trades: During your active session, record each trade you make. You'll input details like symbol, entry/exit price, position size, and importantly, your emotional state at the time and whether you adhered to your plan.

End a Session: Conclude your trading period with a "Post-Session Review." Here, you reflect on the session's outcome, how well you followed your plan, and any emotional challenges or lessons learned. This structured reflection is crucial for psychological growth.

2. Smart Alerts:

Create Custom Alerts: Define alerts with specific names, messages, and even attach sounds, images, or your own 10-second audio recordings. This allows for highly personalized and impactful notifications.

Group Alerts: Combine multiple individual alerts into "Alert Groups."

Schedule Alerts: Use "Monitoring Sessions" to schedule when these alert groups should be active, ensuring you receive relevant alerts only during your planned trading hours.

3. Trading Journal: All trades logged within your sessions are automatically compiled into a comprehensive journal. You can review your past trades, filter them, and sort them to identify patterns.

4. Analytics: Gain insights into your overall performance, including win rates, profit factors, and maximum drawdown. Crucially, analyze your performance based on your emotional state and plan adherence. This helps you see the direct impact of your psychological discipline on your bottom line. Visualize your P&L over time with equity curves and calendar heat maps.

5. Mind Profile:

Define Strengths & Weaknesses: Identify your personal trading strengths (e.g., discipline, risk management) and weaknesses (e.g., FOMO, overtrading).

Build Your Trading Plan: Document your specific trading rules, including preferred markets, conditions to avoid, entry/exit criteria, and position sizing. The app uses this information to provide personalized recommendations and insights on your dashboard, helping you leverage your strengths and work on your weaknesses.

6. Calendar: View all your trading-related events—including your trading sessions, individual trades, news events, and scheduled alerts—in a unified calendar view. This helps you visualize your trading activity and market context over time.

Elevenlabs Conversational Ai Assistant Call for asisstance to get some market related info or just to fine tune the your Smart Alert information and fine tune your trading model.

By consistently using CogniTrade's features, you'll develop a deeper understanding of your trading habits, identify emotional pitfalls, and build the mental fortitude required for consistent success in the markets.

How I built it

This application was built starting from a detailed conceptual word document with instructions of the idea. This initial document outlined the core vision for CogniTrade, detailing its purpose, key features, and the user's journey through the app.

From there, the development process involved:

1. Idea Breakdown: The comprehensive idea was broken down into manageable, distinct sections or modules (e.g., user profiles, trading sessions, alerts, analytics, calendar).

2. Database Schema Design: Based on these modules, a robust database schema was designed using Supabase, defining tables like profiles, trading_sessions, trades, alerts, calendar_events, news_events, and monitoring_sessions. This ensured the data structure supported all intended functionalities.

3. Frontend Development: The user interface was built using React, leveraging the Shadcn/ui component library and Tailwind CSS for styling. Custom React hooks were developed to manage state and interact with the backend.

4. Backend Integration: Supabase was integrated as the backend, handling user authentication, database operations (CRUD for all tables), and file storage for media associated with alerts. Row Level Security (RLS) policies were implemented to ensure data privacy and security.

5. Feature Implementation: Each module's functionality was implemented, connecting the frontend components to the Supabase backend through the custom hooks. This included complex features like real-time alert triggering, session management, and detailed analytics.

6. Refinement: Throughout the process, emphasis was placed on creating a polished, production-ready application with attention to UI/UX, animations, and error handling.

7. Implemented Elevenlabs Ai Conversational Widget I just followed the tutorial from the Elvenlabs site and some help from Bolt.new's intuitiveness.

Challenges I ran into

After building the first attempt with basic functionality it was then that i realized that i needed to be more efficient in prompting Bolt, 10 Million tokens on tap! suddenly became 2 Million in 3 prompts!!. I had to use some of the other AI tools like ChatGPT and Claude to structure my vision correctly (Trusty Word Doc) before i used the prompt in Bolt and save some valuable tokens to get this project done.

After the first week of this challenge i got to the dreading "MIND BLANK" the exact issue i am trying to solve with my app for traders, it took me 7 days to overcome the mental block but I finally took a peace of advice from my own play book and powered trough.

Thanks to Bolt.new's awesome peoples in high places!!! we got some extra "booty" to the tune of 20 MILLION !!

I Know that the biggest challenges I encountered while building this app primarily revolved around reasoning with a machine!. Not in my wildest dreams did i ever think i was going to be experiencing 50 shades of emotions reasoning with Bolt over the same console error, trying to bend it to my will after going round and round in circles more times than Jack Sparrow on the Black Pearl goes round in a maelstrom scene from Pirates of the Caribbean!

And then, the most challenging thing after conquering the "mighty prompt" was probably data integration and consistency with Supabase:

1. Missing Supabase Hooks: Several UI components were designed to interact with data using custom React hooks, but these hooks were not yet implemented, requiring their creation.

2. Property Naming Mismatch: There was an inconsistency between the frontend's camelCase property naming convention and the database's snake_case, which caused data display issues in the analytics section.

3. Incomplete UI for Alert Groups: The user interface for creating alert groups lacked necessary input fields for scheduling specific trigger times.

**4. Authentication Integration: **The initial implementation used local storage for session management, which needed to be replaced with a robust Supabase authentication flow.

5. Elevenlabs Ai integration with Tools: Integrating the full Elevenlabs API system with tool functions got the best of me i could not get around the errors between the Supabase and to call the Ai agent i waisted lots of tokens and ended up getting the Widget working before i ran out of time.

Accomplishments that i an proud of

I Managed to put the idea that i had into reality that can be used and others can use and enjoy it as well.

What I learned

Building an app like CogniTrade Mind Assistant has provided several key lessons:

**Robust Backend Integration is Crucial: **Ensuring a well-structured, secure, and performant database (like Supabase) with proper Row Level Security (RLS) and indexing is fundamental for handling sensitive user data and complex relationships.

Data Consistency is Paramount: Maintaining consistent naming conventions (e.g., snake_case for database, camelCase for frontend) and data types across the entire stack prevents common bugs and simplifies development.

Effective State Management and Data Flow:Implementing custom hooks and migrating from local storage to a centralized data fetching strategy (Supabase hooks) is essential for managing application state efficiently and ensuring data integrity.

User Authentication and Security are Non-Negotiable: Securely handling user authentication and ensuring users can only access their own data is critical for any application dealing with personal performance metrics.

Real-time Communication Enhances User Experience: Features like Picture-in-Picture mode and real-time alerts benefit greatly from cross-window communication mechanisms (e.g., BroadcastChannel), providing a seamless and responsive experience.

Comprehensive Error Handling and Logging: Proactive error handling and detailed logging are vital for debugging, maintaining application stability, and providing a smooth user experience.

Complexity of Integrating Diverse Data: Managing and correlating various types of data—from trading sessions and individual trades to calendar events, news, and multimedia alerts—requires careful planning and execution and tons and tons of patience.

What's next for Cogni Trade Mind Assistant

To further enhance this app in helping traders strengthen their cognitive trading mind i would further implemen: 1. Advanced Cognitive Alerting:

Contextual & Predictive Alerts: Implement alerts that go beyond simple price or time triggers. These alerts would analyze a trader's real-time behavior (e.g., rapid-fire trades, significant changes in position sizing) and cross-reference it with their historical emotional data and trading plan. The goal is to predict and warn against common psychological pitfalls, such as "Warning: Your current trading pattern suggests potential revenge trading. Consider a short break and review your plan."

Personalized "Intervention" Alerts:Allow users to define their own emotional or behavioral triggers. For example, a user could set an alert to trigger if they've taken three losing trades in a row, prompting them to take a mandatory cool-down period or review a specific section of their trading plan.

2. Deeper Psychological Data Capture & Analysis:

In-Session Emotional Micro-Check-ins: Introduce quick, non-intrusive prompts during active trading sessions for users to rate their current emotional state (e.g., a simple 1-5 scale for stress or focus). This granular data would enrich the existing emotional_state column in the trades table and provide more frequent snapshots of a trader's mental state.

Sentiment Analysis on Journal Entries: Apply natural language processing (NLP) to the post_session_review notes in trading_sessions. This would automatically identify recurring emotional patterns, positive/negative sentiment, and highlight areas of psychological strength or weakness that might not be immediately obvious to the user.

3. AI-Powered Cognitive Coaching & Guidance:

**Real-time AI Coach: Leverage the existing ElevenLabs API integration to provide personalized, spoken guidance based on detected emotional states or deviations from the trading plan. For instance, if the system identifies patterns associated with "fear of missing out" (FOMO), the AI could calmly suggest, "Remember your entry criteria. Is this trade aligned with your strategy or external pressure?"

Guided Mindfulness/Breathing Exercises: Integrate short, guided audio exercises that can be triggered by the app when high-stress emotional states are detected. These interventions would help traders regain composure and make more rational decisions during volatile periods.

4. Enhanced Cognitive Analytics Dashboards:

Emotional Impact Analysis:Develop dedicated dashboards that visually correlate emotional states (emotional_state from trades) with trading performance (P&L, win rate, drawdown). This would help traders clearly see which emotions lead to profitable or unprofitable outcomes, fostering self-awareness.

Plan Adherence Deep Dive: Provide detailed reports on deviations from the trading_plan and their direct financial consequences. This would quantify the cost of emotional trading and reinforce the importance of discipline.

Bias Identification: Implement algorithms that analyze trade patterns (e.g., consistently holding losing trades too long, cutting winning trades too short, overtrading) and emotional data to identify common cognitive biases affecting the trader's decision-making.

Built With

Share this project:

Updates