Inspiration

Our inspiration came from seeing a lot of sophisticated trading bots fail. We watched them lose money and thought to ourselves: wow, we can do worse! We set out to build a system that could incinerate capital with the speed and efficiency that only High-Frequency Trading can provide.

What it does

It acts as a highly autonomous money-shredding machine. It scans the market news, reads tweets, gets emotionally attached to stocks like NVIDIA or ING, and then aggressively buys the top just before the price crashes.

Technically speaking, it’s a Sentiment-Based HFT Bot. It polls news feeds, filters out noise (like horoscope tweets), runs an NLP model to decide if news is "Good" or "Bad," and executes trades based on an Alpha Engine. Sometimes it breaks, and you lose money. Sometimes it works perfectly, and you pay so much in fees that you still lose money. It is a marvel of modern engineering.

How we built it

Everything is coded in Python within the Optibook environment. We moved from a "spaghetti code" script to a fully modular Service-Oriented Architecture:

The Brain: We used DistilBART (a transformer model) for Zero-Shot classification to understand market sentiment.

The Guard: We implemented strict Regex filtering to stop the bot from hallucinating (e.g., stopping it from buying "ING" bank just because a headline contained the word "causing").

The Muscle: A multi-threaded Execution Engine that uses Shared Memory and Locks to trade safely without race conditions.

The Helper: Our best friends Gemini and GPT had the privilege of being emotionally mishandled by us during the debugging process.

Challenges we ran into

The "ING" Bug: Our AI was smart, but not street-smart. It kept buying ING Group every time a news headline had a word ending in "-ing" (like "failing" or "surging"). We had to teach it strict word boundaries.

The Need for Speed: Our first model took 1.7 seconds to read a headline. In HFT, that is an eternity. We had to distill the model and optimize our pipeline to get it under 0.6 seconds.

The "Knobs" Problem: There are too many variables. Increasing "Aggression" made us buy the top. Increasing "Sensitivity" made us trade on noise. Finding the balance between "Diamond Hands" and "Panic Selling" was a nightmare.

Self-Sabotage: Our threads kept fighting each other. One thread would buy a stock, and the Inventory Manager would immediately panic and sell it. We had to implement a "Buffer Zone" to stop them from bickering.

Accomplishments that we're proud of

The "SafeExchangeProxy": We built a self-healing connection wrapper. When the exchange kicks us out for spamming requests (which happened often), our bot performs a silent "Hard Reconnect" without crashing the strategy.

Latency Reduction: We successfully cut our inference time by 65% by switching to a distilled model and implementing a "relevance filter" that blocks macro-economic fluff before it hits the GPU.

We stopped the bleeding: We successfully implemented a "Take Profit" logic that unwinds positions when the signal goes neutral, effectively stopping the bot from hoarding stocks until they become worthless.

What we learned

Silence is Gold: The most important part of an AI trading bot isn't what it reads, but what it ignores. Filtering out #GlobalEconomy noise saved us CPU cycles and bad trades.

Speed is expensive: Being a "Taker" (IOC orders) costs the spread. If your AI is 0.5s late, you are just paying the "Winner's Curse" every time.

Concurrency is hard: Without thread locks, your bank account balance is just a theoretical suggestion.

What's next for BlueSky

Actually making money: We are technically currently flat or slightly red, which is a huge improvement from "insolvent."

Market Making: Switching from aggressive "taking" to passive "making" to capture the spread instead of paying it.

Hardware Acceleration: Moving our brain from the CPU to a CUDA-enabled environment to get that inference time down to 0.01s.

Built With

Share this project:

Updates