Inspiration
In retail trading, the real enemy isn't the market; it’s the human brain. Most traders fail because of psychological biases such as revenge trading and Loss Aversion. We used "Affective Labelling", the practice of naming an emotion to strip its power, to build a "Sentience Layer" over the trading terminal. This tool detects emotional spikes before they become financial disasters by making the hidden costs of emotions visible.
What it does
How we built it
HeuristX is a specialized Chrome Extension designed to integrate directly with the browser's runtime for platforms such as TradingView and Trade Nation. Tech Stack: The project is built with TypeScript and JavaScript for reliable logic, using HTML and CSS for the dashboard and floating UI components.\ Core Architecture: We configured a Manifest V3 setup to manage background service workers and content scripts. A MutationObserver monitors the trading platform's DOM in real-time to intercept "Buy" or "Sell" actions for a behavioural audit.\ The Intelligence Engine: We integrated Gemini 2.0 Flash to analyze unstructured trade data. This allows the system to identify the intent behind a trade, distinguishing between a disciplined strategy and an emotional spiral.\ Data & Storage: Historical analysis is handled via a CSV pipeline for "Bias Autopsies," while chrome.storage.local securely manages API keys and session data on the user's device.
Challenges we ran into
Implementing the Gemini API within the restricted environment of a Chrome Extension Service Worker posed significant technical hurdles, particularly due to script compatibility and secure key management without a traditional backend. We also encountered a major logical obstacle, the "Volume Bias" trap, in which our initial scoring system unfairly penalized users with a 5/100 score by incorrectly equating high trade counts with automatic overtrading. To resolve this, we refined our instructions to the AI, shifting the focus toward Position Size Variance and Relative Density to ensure that professional, high-volume strategies were judged on consistency rather than just raw numbers. Furthermore, managing the complexity of massive single-page applications like TradingView required us to engineer a robust observation system. This system had to be meticulously optimized to capture data accurately from the interface, ensuring our "Bias Autopsy" could be performed without missing critical trade data or causing performance issues in the browser environment.
Accomplishments that we're proud of
We are most proud of engineering a "Sentience Layer" that operates with sub-second latency, allowing us to intercept impulsive trades and provide an AI-backed "Circuit Breaker" before a user commits a costly mistake. By leveraging Gemini 2.0 Flash, we moved beyond basic rules to achieve true contextual intelligence, enabling the system to recognize 13 distinct psychological biases even in high-frequency trading environments. Our team successfully developed a normalized scoring algorithm that maintains accuracy across datasets with more than 10,000 trades, ensuring that professional scalpers aren't unfairly penalized for their volume. This cross-platform stability across complex apps like TradingView and Trade Nation marks a significant milestone in bringing behavioural quant analysis to retail traders.
What we learned
Building HeuristX taught us that AI's most profound impact on finance lies in predicting human error rather than market movements alone. We mastered the intricacies of Chrome Extension architecture, specifically the delicate balance of managing communication between content scripts and background workers while minimizing latency. We discovered the clinical efficacy of "Affective Labelling," observing that simply identifying a bias by name can statistically reduce a trader's impulsive responses. Furthermore, navigating the strict security and lifecycle constraints of Manifest V3 deepened our understanding of local-first engineering and the importance of secure, local-only data management for sensitive financial information.
What's next for HeuristX
Looking forward, HeuristX aims to evolve ZenTrade from a reactive tool into a predictive one by integrating "Tilt" detection that analyzes early stress indicators like typing cadence or biometric data. We plan to build a "Prosperity" community benchmark, enabling users to compete on discipline scores rather than raw profits. Our roadmap also includes pursuing direct brokerage partnerships to implement native account locks and incorporating multi-modal analysis to capture environmental stress factors that raw data misses.
Built With
- javascript
- next.js
- python
- typescript
Log in or sign up for Devpost to join the conversation.