Leveraging AI/ML for Finance and Trading: A Journey from ML Models to a 23% Gain in simulated environment with an AI-Powered Strategy.
Using Sentiment Analysis for Smarter AI-Based Trading Strategies
As a AI and finance enthusiast, I am constantly exploring ways to integrate technology into financial markets. My journey began with building a LightGBM model that took five technical indicators computed on historical stock data as features to predict whether to go Long or Short on a stock. While this was my first attempt at applying machine learning to trading, I quickly realized that traditional ML approaches had significant limitations.
Limitations of Traditional ML Approaches in Trading
Traditionally, the application of Machine Learning (ML) in trading has involved training models using a set of technical indicators as features to predict whether to go Long or Short on a stock. While some variations of this method have shown success, I believe this approach underutilizes the true power of AI.
At its core, ML attempts to learn how to weigh multiple variables in a complex multivariate equation to make predictions. However, the issue with relying solely on technical indicators is that they are inherently lagging indicators—derived from past price and volume data, meaning they react to price movements rather than drive them. This raises an important concern:
Are we really predicting price movements, or are we just identifying patterns in historical data?
From Finsight to AI-Powered Trading
Following my initial ML experiments, I conceptualized and collaborated with my friend Vishwas Gowda to develop Finsight, an application designed to analyze annual reports of publicly listed companies and generate section-specific actionable insights using a Large Language Model (LLM). This tool allowed investors to extract crucial financial information efficiently, making fundamental analysis more accessible. Such projects have helped me gain a greater understanding of what factors drives prices.
More recently, I have advanced to building an AI/NLP-based trading strategy, which has just yielded 23% returns across 96 trades in 2 months in a simulated trading environment. This represents a significant evolution in my work across both AI and trading, integrating multiple dimensions of financial analysis into a cohesive AI-driven trading model.
The Real Driver of Stock Prices: Supply & Demand
Stock prices are primarily dictated by supply and demand dynamics, not just technical patterns. While technical indicators reflect market behavior, they do not cause price movements. The true factors that drive prices are often linked to market sentiment, macroeconomic events, earnings reports, news catalysts, and institutional order flow.
This is why i believe that a more effective approach to gaining an edge in the market is to incorporate sentiment analysis—understanding how events, news, and economic shifts influence market participants' decisions to buy or sell. AI can be leveraged to analyze real-time news, social media sentiment, and economic indicators to anticipate shifts in supply and demand before they are reflected in price charts.
By integrating event-driven sentiment analysis with traditional quantitative strategies, AI-powered trading systems can move beyond lagging indicators and instead anticipate future price movements more effectively. This approach has the potential to unlock a far more powerful and predictive trading strategy.
Why Context Matters in Sentiment Analysis for Trading
As all AI practitioners know, context is a crucial component of sentiment analysis. Sentiment alone isn’t enough—understanding the broader context in which an event occurs is what truly determines its impact on market behavior.
For example, consider interest rate cuts by a central bank:
If rates are cut during a period of economic expansion it may be seen as bullish encouraging borrowing, corporate growth, and stock market rallies.
However, if rates are cut during an economic downturn, it might signal panic, suggesting that policymakers are worried about a financial crisis—leading to negative sentiment and market sell-offs.
This is where fundamental analysis becomes crucial.
The Role of Fundamental Analysis in Trading
Fundamental analysis provides the essential context needed to interpret sentiment correctly.
It gives us a backdrop for evaluating how news events, earnings reports, or economic policies might impact market sentiment.
Without it, sentiment analysis could misinterpret an event’s significance, leading to false trading signals.
The Path to a True Trading Edge
To develop a robust AI-driven trading strategy, we must integrate three key components:
1️⃣Fundamental Analysis → Provides context about a company’s financial health and valuation.
2️⃣Sentiment Analysis → Evaluates how news and macroeconomic events influence investor sentiment.
3️⃣Technical Analysis → Identifies price trends and patterns for trade execution.
By combining fundamental context, sentiment insights, and technical signals, traders can develop a true edge in the stock market—one that adapts to market conditions rather than blindly following lagging indicators.
Developing My AI/NLP-Based Trading Strategy
To create a realistic and robust trading model, I designed a news-driven trading strategy with strict assumptions to simulate live trading conditions as accurately as possible.
How it works:
1️⃣ Data Collection & Sentiment Analysis:
Scraped stock-related news data.
Used Named Entity Recognition (NER) to identify referenced stocks.
Retrieved fundamental data scraped from Screener.in and stored as embeddings in Weaviate for the mentioned stocks.
Applied Sentiment Analysis on the news, using fundamental data as context.
2️⃣ Technical Analysis & Trade Execution:
Identified entry points based on a mix of sentiment and technical indicators.
Applied fixed methods to set target prices and stop-losses.
Used a trailing stop-loss mechanism to lock in profits while minimizing risk.
3️⃣ Simulated Paper Trading Environment:
Trades were executed based on minute-wise price data from the moment the news was published.
The trade duration was capped at the end of the following trading day.
If the stock hit neither the target nor the stop-loss, the exit price was set to the closing price of the next trading day. The stop-losses were trailed based on pre-defined rules.
No lookahead bias was introduced, ensuring realistic decision-making based on available information.
Results: A Promising Start
After two months of simulated trading, the strategy yielded a +23% return over 90 trades.
Trade Breakdown:
96 Long Trades
33 Loss Trades
20 Break-Even Trades (due to trailing stop-losses)
43 Profitable Trades
📌 Future iterations will focus on testing across different market conditions to validate robustness.
What’s Next?
🚀 Continuous Improvement & Live Testing
I will continue refining and optimizing the strategy.
I plan to live-trade promising strategies over the next 3-4 months and analyze real-world performance.
Testing ideas for futures and options also.
📌 The first steps have been taken, but the road to mastering AI-driven trading is long. I look forward to the journey ahead.
Let’s Connect!
📩 Reach out to me at: engineering@intuitifi.com 💼 LinkedIn: Vikas Srinivasa