Building an AI Trading Bot: Dashboard, Strategies & Decision Engine

AI Trading Bot that combines 3 powerful LLMs – DeepSeek V3, GPT-4o-mini, and Claude – with technical analysis to automate cryptocurrency trading decisions 24/7 on self-hosted infrastructure.

What is This AI Trading Bot?

This AI Trading Bot is a personal project that automates cryptocurrency trading decisions using a combination of technical indicators and multiple Large Language Models. The system analyzes market data, generates price forecasts, and executes trades based on AI-powered strategies – all without manual intervention.

The bot currently runs on Hyperliquid Testnet, allowing safe experimentation with trading strategies before deploying real capital. It supports multiple cryptocurrencies including BTC, ETH, SOL, and various altcoins.

Trading Dashboard Overview

The web-based dashboard provides a comprehensive view of the trading system. At a glance, you can see your portfolio value, unrealized P&L, current positions, and portfolio allocation.

AI Trading Bot Dashboard showing portfolio, positions and P&L
AI Trading Bot Dashboard with portfolio overview, allocation chart, and live positions

The dashboard displays:

  • Portfolio Value – Total account balance including open positions
  • Unrealized P&L – Current profit/loss on open trades
  • Position Count – Number of active trades
  • Portfolio Allocation – Visual breakdown of cash vs. invested assets
  • Live Positions – Real-time view of open trades with entry price, target, stop loss, and current P&L

Two Trading Strategies

The system runs two distinct trading bots, each optimized for different market conditions:

📈 Trend Follower

  • Assets: BTC, ETH, SOL
  • Cycle: 1 hour analysis
  • Strategy: Follows established trends
  • Duration: Holds for hours to days
  • Risk: Moderate leverage (3x)

âš¡ Scalper

  • Assets: All altcoins (excl. BTC/ETH/SOL)
  • Cycle: 10 minute analysis
  • Strategy: Quick momentum trades
  • Duration: Minutes to hours
  • Risk: Higher leverage (5x)
Bot Status showing Trend Follower and Scalper strategies enabled
System Info page showing both trading bots enabled with their configurations

AI Trading Bot Decision Engine

The heart of this AI Trading Bot is the AI Decision Engine – a sophisticated system that combines two scoring mechanisms to make trading decisions:

Tech Score (0-10) + AI Score (0-10) = Combined Score

Example: Tech 9/10 + AI 7/10 = Combined 8.2 → LONG signal

The Technical Score is calculated automatically by the EntryGates system, analyzing trend alignment, momentum indicators, and volume patterns.

The AI Score comes from Large Language Models that evaluate market context, sentiment, and pattern quality. The AI Trading Bot uses multiple LLMs via OpenRouter – including DeepSeek V3, GPT-4o-mini, and Claude (both via API and claude -p CLI) – each optimized for different trading scenarios.

AI Decision History showing HOLD decisions with technical and AI scores
Decision History showing the AI reasoning process with combined scores and thesis validation

Each decision includes detailed reasoning:

  • Trend Analysis: Uptrend weak/strong, sideways movement
  • RSI Status: Overbought, oversold, neutral
  • MACD Signal: Histogram increasing/decreasing
  • Position Status: Near target, near stop, in profit zone
  • Thesis Validation: VALID, INVALID, TARGET_NEAR

Prophet Price Forecasting

The system integrates Facebook Prophet for time-series forecasting. Prophet analyzes historical price data and generates predictions for multiple timeframes (1h, 4h), including confidence intervals.

Market Charts showing BTC price with Prophet forecasting overlay
BTC Price chart with Prophet forecasting showing predicted price ranges and entry/exit points

The chart displays:

  • Price Candles: Real-time OHLC data from the exchange
  • Forecast Line (1h): Short-term price prediction
  • Forecast Line (4h): Medium-term direction
  • Confidence Bands: Upper and lower forecast bounds
  • Entry/Exit Markers: Historical trade points
  • Volume Bars: Trading activity below the chart

Position Management

Each open position is tracked with comprehensive details including entry thesis, key price levels, and real-time P&L updates.

Open Positions view with market indicators and position details
Open Positions page showing Fear & Greed index, market data, and active trade details

The positions view includes market context:

  • Fear & Greed Index: Current market sentiment
  • BTC Dominance: Bitcoin’s market share
  • Total Market Cap: Overall crypto market size
  • Position Card: Entry, P&L, leverage, hold time, target, stop loss
  • Visual Progress Bar: Price position between stop loss and target

Trade Details & Analytics

Every trade is logged with complete details for analysis and optimization. The Trade Log shows historical performance with filtering by date, bot, symbol, direction, and status.

Trade Log showing filtered trades with P&L and win rate statistics
Trade Log with filtering options and performance statistics

Clicking on any trade reveals detailed information:

Trade Details modal showing entry, exit, fees, and P&L breakdown
Detailed trade view with entry/exit prices, fees, leverage, duration, and net P&L

Performance Analytics

The Analytics page provides insights into overall performance and bot comparison, helping identify which strategies work best in different market conditions.

Analytics dashboard with performance metrics and cumulative P&L chart
Analytics showing overall performance, bot comparison, and cumulative P&L over time

Key metrics tracked:

  • Total P&L: Cumulative profit/loss
  • Win Rate: Percentage of profitable trades
  • Trade Count: Total number of trades with W/L/BE breakdown
  • Average Win/Loss: Typical profit and loss per trade
  • Bot Comparison: Side-by-side performance of Trend Follower vs. Scalper
  • Cumulative Chart: Visual representation of P&L over time

Technology Stack

The AI Trading Bot is built with modern technologies:

  • AI/LLM: OpenRouter (DeepSeek V3, GPT-4o-mini) + Claude CLI (claude -p)
  • Price Forecasting: Facebook Prophet for time-series predictions
  • Backend: Python with FastAPI
  • Frontend: Streamlit dashboard
  • Database: PostgreSQL for trade history and market data
  • Exchange: Hyperliquid API integration
  • Infrastructure: Docker containers on Raspberry Pi cluster
  • Data Pipeline: Apache Kafka for real-time event streaming (covered in Part 2)
  • Notifications: Telegram via n8n workflows

3 LLMs Power This AI Trading Bot

What makes this AI Trading Bot unique is the deep integration with 3 Large Language Models. Each trading decision is made by an AI that receives structured market data and returns reasoned trading decisions in JSON format.

The system uses OpenRouter to access multiple LLMs:

  • DeepSeek V3 – Powers the Trend Follower with complex market analysis
  • GPT-4o-mini – Lightning-fast decisions for the Scalper bot
  • Claude (via API + claude -p CLI) – Alternative model for validation and comparison

Each bot has custom prompts that inject real-time market data, open positions, risk parameters, and scoring rules. The LLM analyzes this context and provides trading signals with detailed reasoning – which is then validated by the system before execution.

This approach combines the pattern recognition capabilities of LLMs with deterministic risk management rules, creating a hybrid AI Trading Bot that’s both intelligent and disciplined.


What’s Next?

In Part 2, we’ll explore the Data Pipeline that powers this AI Trading Bot – how trade notifications flow through Kafka, get processed by n8n workflows, stored in a data lake, and delivered to Telegram for real-time alerts.

Disclaimer: This is a personal project running on testnet for educational purposes. Cryptocurrency trading involves significant risk. Never trade with money you cannot afford to lose.

Related Reading

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top