Inspiration

Backtesting trading strategies is usually done on historical data—but the market only represents one stochastic path. This leads to overfitting and unrealistic performance expectations. We wanted to build a tool that simulates alternative market scenarios so traders can test their own strategies in an interactive way, allowing for more robust trading.

What it does

BlackSwan generates synthetic financial market data using a GAN (Generative Adversarial Network) tailored for time-series inputs. It then allows users to backtest their own trading strategies against this simulated data with an AI-powered chatbot. The platform supports conversational interaction, allowing users to ask questions or run backtests using natural language. This creates an intuitive experience where even non-technical users can explore how strategies behave under alternate market paths.

How we built it

We utilized SeriesGAN, a framework that allows for time series generation, to capture the temporal structure of financial data. On the backtesting side, we developed a modular engine that includes position sizing, stop loss, take profit, and multiple strategy types ranging from momentum to mean reversion. For interaction, we used LangChain with Gemini to parse user input and translate it into structured strategy parameters. To support persistent storage and serve visual outputs, we integrated AWS S3 and set up proper permissions and CORS configurations for web compatibility. We also implemented Auth0 for authentication and user management.

Challenges we ran into

Training GANs on financial data proved tricky. Unlike natural images, financial time-series data is noisy, non-stationary, and highly sensitive to small perturbations. We had to carefully tune our architecture and training loop to avoid mode collapse and generate sequences with realistic volatility and trends. Another challenge was designing prompts that reliably extracted structured input from natural language. Ensuring our chatbot could handle vague or incomplete questions without failing took a lot of iteration.

Accomplishments that we're proud of

We’re especially proud of the fact that we created a full pipeline—from generating fake market data to backtesting to conversational analysis—all in 24 hours. The strategies our users can test aren’t just toy examples; they include real-world techniques with parameter controls and risk management logic. On top of that, we enabled interaction through a chatbot that can explain results, adjust strategies, or generate new synthetic paths on demand. The final product feels cohesive and interactive, with serious potential for educational, research, or even pre-production quant workflows.

What we learned

This project taught us a lot about bridging machine learning and user experience. We saw firsthand how even a great model is only useful if users can interact with it meaningfully. Prompt engineering became its own design problem, and we learned to build flexible, fault-tolerant parsing logic to make natural language a viable interface. From a technical perspective, we deepened our understanding of financial data dynamics and how different modeling assumptions can drastically affect simulated outcomes.

What's next for BlackSwan

We hope to make synthetic backtesting a common step in any trader’s workflow—whether they’re building hedge fund infrastructure or learning the basics from home.

Built With

Share this project:

Updates