AI Trading System

Hybrid system for algorithmic trading of cryptocurrency futures using orchestrated LLM agents and advanced technical analysis.

FinTech AI / LLM Algo Trading Automation
24/7

Autonomous operation

6

AI agents in system

3-5 x

Analysis speedup

100 %

Automation

About the project

The project is an automated trading system for crypto futures. A key feature is offloading all analytical logic to an external, independent module — the AI Agents Orchestrator.

What makes it unique: A combination of a reliable execution core for trade management with the flexibility and power of modern LLMs for complex non‑linear market analysis.

6‑Agent System

Each agent performs a specialized task. Agents 1 and 2 run in parallel (ThreadPoolExecutor).

Coin Hunter

Searches for promising coins via LLM with web search. Queries Perplexity Sonar and extracts a JSON list of tickers.

Perplexity Sonar via OpenRouter
Cache 4h Interval 12h Validation

Data Collector

Collects market data: OHLCV (1H/4H/1D), ticker, funding rate, Open Interest. Filters by volume and spread.

CCXT (Bybit Futures)
MIN_VOL $10M MAX_SPREAD 0.2% OI History

News Analyst

Analyzes 7‑day news. Exponential decay of impact. Extracts key_events with dates and impact.

Perplexity Sonar via OpenRouter
Impact -2..+2 Decay 24h key_events[]

Math Engine

Calculates scores: Trend, Momentum, Volume, Liquidity. Detects market regime. Ensemble voting.

pandas-ta, numpy, Ensemble
Smart RSI Regime Detector Confidence

Risk Manager

Forms the final signal (LONG/SHORT/WAIT). Computes SL/TP and leverage. Dynamic weights by regime.

Quantile SL, ATR-based, MTF Veto
Smart Sizing Funding Veto News Regime

Telegram Broadcaster

Publishes signals, stats, and Market Pulse. Entry/exit posts with reply. Deduplication.

Telegram Bot API
Entry/Exit Posts Stats Disclaimer

How a trading signal is formed

Final score: from -1 to +1

The system analyzes the market and gathers data from different sources. Based on these inputs it computes a final score — a number indicating whether to buy or sell.

Score > +0.45 → Buy signal (LONG)
Score < -0.45 → Sell signal (SHORT)
Between -0.45 and +0.45 → Wait for a better moment (WAIT)

Score components:

Trend (35-45%)

Price position relative to 20/50/200‑period MAs. MA slope used for confirmation.

Momentum (15-35%)

RSI with smart interpretation: in trend, high RSI = strength; in range, high RSI = overbought.

Volume (5-10%)

Buyer/seller pressure and market liquidity analysis.

Open Interest (15%)

Detects potential squeezes: Short squeeze and Long squeeze.

News (15-20%)

AI‑based news analysis with exponential impact decay.

Multi‑timeframe

1H (30%) + 4H (50%) + 1D (20%). Daily timeframe has veto in case of disagreement.

Example trading signal

LONG BTC/USDT
Confidence: 0.72
Entry
$43,250
Stop‑loss
$41,900
TP1 (50%)
$45,275
TP2 (50%)
$46,625
Leverage
7x
Risk
1.5%

Capital protection

1.5 %

Risk per trade

-5 %

Daily loss limit

10x

Max leverage

3

Max positions

Adaptive leverage

Leverage is calculated individually per trade. The higher the volatility, the lower the leverage:

  • Volatility 4% → leverage 3x (very risky)
  • Volatility 3% → leverage 5x (risky)
  • Volatility 2% → leverage 7x (crypto norm)
  • Calm asset → leverage 10x (maximum)

ATR-based Stop Loss

Stop is calculated from the asset's real movements over the last 30 days (ATR). Protects from market noise with bounds: min 1.5%, max 5%.

Take‑profit system

TP1
Risk × 1.5
Close 50% of position
TP2
Risk × 2.5
Close the remainder

Trailing stop

The stop follows the price to protect profit:

  • Phase 1: Profit < 2.5% — stop stays
  • Phase 2: Profit ≥ 2.5% → stop moves to entry + 0.15% (breakeven)
  • Phase 3: After TP1 — stop trails price at 2% distance

News impact

The AI agent analyzes the news background over the last 7 days. Fresh news matters more than old:

Impact decay:
After 24 hours — impact halves
After 48 hours — to 25%
After 7 days — almost ignored

Market regimes after critical news

PANIC

Volatility 2.5x above normal
Leverage ×0.5, Stop ×1.5

DIGESTING

Volatility 1.3x above normal
Leverage ×0.8, Stop ×1.2

NORMAL

Usual volatility
Standard parameters

News agent veto right

When critical news is detected (exchange hack, SEC lawsuit, ETF approval), the agent can veto a trade or, conversely, become the main driver for entry.

Protective mechanisms

  • Spread control: No entries if spread > 0.2%
  • BTC filter: No longs if BTC fell more than 2% over 4 hours
  • Stale exit: Close a position if it lingers 48+ hours with profit < 1%
  • News panic: Close position on critical negative news
  • Minimum volume: Trade only coins with volume > $10M per day
  • Circuit breaker: If daily loss reaches -5%, trading stops
  • Correlation: Limit positions in similar assets (BTC group, Layer 1, memecoins)
  • Extreme funding: Block entries if funding > 0.25% over 8 hours

Technologies and integrations

Language Python 3
AI/LLM Perplexity Sonar, GPT
API provider OpenRouter
Exchange Bybit API
Libraries Pandas, NumPy, CCXT
Technical analysis Pandas-TA
Notifications Telegram API
Caching Redis / file cache
Parallelism ThreadPoolExecutor

Implementation results

  • Analysis speed 3–5x: Full cycle from coin discovery to signal generation shortened thanks to parallel processing.
  • Higher signal quality: Combining technical, news, and volume analysis filters out false signals.
  • Full autonomy 24/7: Works without human intervention, adapting to market conditions and managing risk.
  • Safe testing: dry_run mode and demo account allow hypothesis testing without risking real capital.

Advantages of the approach

Lower costs

Automating the full cycle frees analysts' time for developing new strategies.

Scalability

Parallel processing lets you analyze dozens of assets without increasing cycle time.

No emotions

The system eliminates fear, greed and fatigue — decisions are strictly data‑driven.

Modularity

Any agent can be replaced or modified without affecting the rest of the system.