Back to blogIndicators
How AI stock analysis actually works: behind the algorithm
June 8, 2026 · 7 min read
Every stock on TradewithAI gets a Swing Score from 1 to 10 and a verdict of Buy, Sell, or Neutral. Here is exactly how the algorithm works.
Step 1: Data collection
We fetch 30 days of OHLCV (Open, High, Low, Close, Volume) data from Yahoo Finance for every stock in your watchlist. This gives us enough data to calculate all 7 indicators.
Step 2: Calculate 7 indicators
RSI (Relative Strength Index): Measures momentum over 14 periods. Below 30 means oversold. Above 70 means overbought.
SMA 20, 50, 200: Simple Moving Averages at three timeframes. We detect golden crosses (50 above 200) and death crosses (50 below 200). We also check if the price is above or below the 200 day SMA.
MACD: We track 6 states from bullish cross (strongest buy) to bearish cross (strongest sell). The crossover is the moment of change.
Bollinger Bands: We detect when price touches the lower band (potential buy), upper band (potential sell), or when bands squeeze (big move coming).
Volume: We compare today's volume to the 20 day average. A spike above 2x average with a price drop often marks a bottom.
Support and Resistance: We identify key price levels where the stock has historically bounced or been rejected.
Swing Score: Combines all indicators into a single 1 to 10 attractiveness score.
Step 3: Count votes
Each indicator casts buy or sell votes. RSI below 30 is plus 2 buy votes. MACD bullish cross is plus 2 buy votes. Death cross is plus 2 sell votes. And so on.
Step 4: Generate verdict
If 65 percent or more votes are buy, the verdict is Strong Buy. If more buy than sell, it is Buy. If 65 percent or more are sell, it is Strong Sell. Otherwise Neutral.
Step 5: AI analysis
When you click Analyze on a stock, we send all 7 indicators plus the verdict to DeepSeek AI. The AI writes a human readable analysis with entry price, target price, stop loss, and risk assessment.
This is not a black box. Every indicator is visible on your dashboard. The AI just saves you 20 minutes of analysis per stock.
Try these indicators yourself
Open TradewithAI dashboard