Skip to content

Public Multi-strategy trading bot with level-based support/resistance, whale detection, and adaptive risk management

License

Notifications You must be signed in to change notification settings

devstd2211/edison-smart-levels-trading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

289 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EDISON - Smart Levels Trading Bot

Screenshot

🎯 What Is This?

Edison is an educational TypeScript trading bot that demonstrates how to build professional algorithmic trading systems using Smart Money Concepts (SMC) strategies.

Key Facts:

  • Educational only - Learn professional trading bot architecture
  • Configuration-driven - Create/modify strategies via JSON (no coding)
  • Multi-strategy - 14+ pre-built strategies to choose from
  • Bybit Futures - Real exchange integration (testnet/demo)
  • 2500+ tests - Production-grade code quality
  • Smart Money Concepts - Liquidity zones, order blocks, SMC patterns

Demo account trading ONLY - NOT for real money. See ⚠️ disclaimer below.


⚠️ Risk Warning (Read This)

BEFORE YOU START: This bot is for DEMO/TESTNET trading only. Using it on real money accounts will likely result in complete loss of your deposit. Not a suggestion - a fact.

  • 🚨 Demo ONLY - Bybit testnet or demo accounts
  • 🚨 Not profitable - Past results ≠ future results
  • 🚨 Can lose everything - Your responsibility alone
  • 🚨 NOT financial advice - Educational demonstration only

Full legal disclaimer below


⚡ Quick Start (5 Minutes)

Prerequisites

  • Node.js 18+, npm 9+
  • Bybit account (use DEMO, not live!)
  • API key + secret from Bybit

1️⃣ Setup

git clone https://github.com/devstd2211/smart-levels-trading-bot.git
cd smart-levels-trading-bot
npm install

2️⃣ Configure

cp .env.example .env
# Edit .env with your Bybit DEMO API keys:
# BYBIT_API_KEY=your_demo_key
# BYBIT_API_SECRET=your_demo_secret
# BYBIT_TESTNET=true

cp config.example.json config.json
# Edit config.json with trading settings (symbol, leverage, risk, etc.)

3️⃣ Run

npm run dev

✅ Bot connects to Bybit DEMO, downloads candles, and starts trading!


📑 Table of Contents


🎮 What This Bot Does

Trading Strategies

Strategy Purpose
Level Trading Trade support/resistance levels detected from swing points
Whale Hunter Detect and trade large order walls and liquidity sweeps
Scalping Micro-wall detection, tick delta, ladder TP, order flow
Liquidity-Based Trade around liquidity zones and order blocks
Swing Trading Multi-timeframe swing detection and reversals

View all 14+ strategies in strategies/json/README.md

Smart Money Concepts Built-In

  • 🎯 Liquidity Zones - Identify where big traders place stops
  • 🎯 Order Blocks - High-probability reversal areas
  • 🎯 Break of Structure - Trend changes and reversals
  • 🎯 Fair Value Gaps - Price gaps for reversal trading
  • 🎯 Divergences - Price vs indicator mismatches

Risk Management

  • Position Sizing - Automatic USDT or risk % based
  • Stop Loss - ATR-based or fixed distance
  • Take Profits - Multi-level exits (TP1, TP2, etc.)
  • Trailing Stops - Lock profits as price moves
  • Filters - Market structure, volatility, correlation checks

⬆ Back to TOC


🛠️ Configuration Guide

How to Configure (3 Files)

1. .env → API Keys (keep secret!)

BYBIT_API_KEY=your_demo_key
BYBIT_API_SECRET=your_demo_secret
BYBIT_TESTNET=true

2. config.json → Trading Settings

{
  "exchange": {
    "symbol": "XRPUSDT",
    "timeframe": "5",
    "testnet": true,
    "demo": true
  },
  "trading": {
    "leverage": 5,
    "riskPercent": 1
  },
  "riskManagement": {
    "positionSizeUsdt": 10,
    "stopLossPercent": 2.5,
    "takeProfits": [
      { "level": 1, "percent": 0.5, "sizePercent": 70 },
      { "level": 2, "percent": 1.0, "sizePercent": 30 }
    ]
  }
}

3. strategies/json/*.strategy.json → Choose Strategy

{
  "metadata": { "name": "Level Trading - Single EMA" },
  "analyzers": [
    { "name": "EMA_ANALYZER_NEW", "enabled": true, "weight": 1.0 },
    { "name": "DIVERGENCE_ANALYZER_NEW", "enabled": true, "weight": 0.8 }
  ]
}

Read config.example.json for detailed explanation of each setting

⬆ Back to TOC


📊 System Architecture (Visual)

How It Works: 4-Layer System

┌─────────────────────────────────────────────────────────┐
│  LAYER 4: EXECUTION (Services)                          │
│  ↓ Orders, positions, risk management, logging          │
├─────────────────────────────────────────────────────────┤
│  LAYER 3: ORCHESTRATORS (Coordination)                  │
│  EntryOrchestrator ← Rank signals → ExitOrchestrator    │
├─────────────────────────────────────────────────────────┤
│  LAYER 2: ANALYZERS (Decision Logic) ×29                │
│  EMA | RSI | Divergence | Order Blocks | Liquidity Zones│
├─────────────────────────────────────────────────────────┤
│  LAYER 1: INDICATORS (Raw Math) ×6                      │
│  EMA | RSI | ATR | Volume | Stochastic | Bollinger      │
├─────────────────────────────────────────────────────────┤
│  MARKET DATA                                            │
│  ← Bybit WebSocket: Real-time candles, orderbook, trades│
└─────────────────────────────────────────────────────────┘

⬆ Back to TOC

Data Flow: From Candle to Trade

New Candle Closes
     ↓
Load 1000 Historical Candles
     ↓
Run All Enabled Analyzers
├─ EMA Analyzer: "LONG @ 0.75"
├─ Divergence Analyzer: "LONG @ 0.60"
└─ Other Analyzers...
     ↓
Filter Signals (market structure, volatility, etc.)
     ↓
EntryOrchestrator: Average confidence > threshold?
     ↓
If YES → Calculate position size → Place order
     ↓
Monitor: Watch for TP/SL hits
     ↓
Exit and Log Trade

⬆ Back to TOC


✅ What Is Edison / ❌ What Is NOT

✅ Edison IS...

Feature What You Get
Educational Learn professional trading bot architecture
Configuration-Driven Edit JSON to create/modify strategies (no coding)
Multi-Strategy 14+ pre-built strategies, mix them together
Real Exchange Actually trades on Bybit Futures (testnet/demo)
Production Code 2500+ tests, full TypeScript strict mode
Modular Add new analyzers without changing orchestrators
SMC-Focused Liquidity zones, order blocks, fair value gaps

❌ Edison IS NOT...

Myth Reality
Profitable Past results ≠ future results. Markets change.
For Live Trading Demo/testnet ONLY. Will lose real money.
Financial Advice Educational demo. Do your own research.
Easy Money Trading is hard. Most bots lose money.
Ready to Use Requires configuration and testing first.
Magic It's code + logic. No magic, just algorithms.

⬆ Back to TOC


📝 Common Commands

Development

npm run dev              # Start bot with live trading
npm run build            # Compile TypeScript
npm test                 # Run 2500+ unit tests
npm run lint             # Check code style
npm run format           # Auto-format code

Testing & Analysis

npm run backtest:sqlite          # Backtest with historical data
npm run analyze-journal          # View trading performance
npm run analyze-losses           # Analyze losing trades
npm run download-data XRPUSDT 2025-01-01 2025-01-31  # Download candles

⬆ Back to TOC


🎯 Building Blocks Architecture

Edison is built on a modular "building blocks" pattern where you compose trading strategies by assembling pre-built components through configuration - no coding required.

How It Works

Instead of hardcoding strategies, Edison uses configuration-driven assembly:

Configuration (JSON)
    ↓
Selects & combines analyzers
    ↓
Orchestrators coordinate decisions
    ↓
Trading execution

The Three Layers

Layer 1: Indicators (Raw Calculation)

Indicators are pure calculation engines that compute values from candle data:

Input: Candles (OHLCV data)
    ↓
Processing: Apply algorithm (EMA, RSI, ATR, etc.)
    ↓
Output: Numeric values (fast EMA, slow EMA, RSI, etc.)

6 Technical Indicators Available:

  • EMA - Exponential Moving Average (trend direction)
  • RSI - Relative Strength Index (overbought/oversold)
  • ATR - Average True Range (volatility)
  • Volume - Volume strength analysis
  • Stochastic - %K/%D crossover signals
  • Bollinger Bands - Band touch/break patterns

What indicators DO: Calculate values What indicators DON'T: Make trading decisions (that's the analyzer's job)

Layer 2: Analyzers (Decision Logic)

Analyzers are decision engines that use indicators to generate trading signals with confidence scores:

Input: Candles + Indicator values
    ↓
Analysis: Check for signal conditions
    ↓
Calculation: Compute confidence (0.0 - 1.0)
    ↓
Output: AnalyzerSignal
{
  "analyzer": "EMA_ANALYZER",
  "direction": "LONG",      // or SHORT
  "confidence": 0.75,       // 75% confidence
  "timestamp": 1234567890
}

29 Analyzers Across 6 Categories:

  1. Technical Indicators (6):

    • EMA_ANALYZER → EMA crossover signals
    • RSI_ANALYZER → Overbought/oversold signals
    • ATR_ANALYZER → Volatility signals
    • VOLUME_ANALYZER → Volume strength signals
    • STOCHASTIC_ANALYZER → %K/%D signals
    • BOLLINGER_BANDS_ANALYZER → Band signals
  2. Advanced Analysis (4):

    • Divergence detection (price vs indicator)
    • Breakout detection (level breaks)
    • Wick analysis (rejection patterns)
    • Price momentum
  3. Structure Analysis (4):

    • Trend detection (HH/HL/LH/LL)
    • Swing detection
    • Level detection
    • Change of Character / Break of Structure
  4. Liquidity & Smart Money (8):

    • Liquidity sweep detection
    • Liquidity zones
    • Order blocks
    • Fair value gaps
    • Volume profile
    • Order flow
    • Footprint analysis
    • Whale detection
  5. Micro-Level Analysis (3):

    • Micro walls
    • Delta analysis
    • Tick delta
  6. Additional (3):

    • Price action
    • Trend conflict
    • Volatility spikes

Layer 3: Orchestrators (Workflow Coordination)

Orchestrators are decision coordinators that use signals from multiple analyzers to make trading decisions:

EntryOrchestrator
├─ Receives: [signals from all enabled analyzers]
├─ Ranks: By confidence score
├─ Filters: Apply trading rules (risk management, trend alignment)
└─ Decides: ENTER / SKIP / WAIT

FilterOrchestrator
├─ Receives: [signals]
├─ Applies: 8+ trading filters
│  ├─ Blind zone (need N confirmations)
│  ├─ Flat market (reject in consolidation)
│  ├─ ATR filter (volatility check)
│  ├─ BTC correlation (market direction)
│  └─ ... (4 more filters)
└─ Returns: [filtered signals]

ExitOrchestrator
├─ Monitors: Position state
├─ Checks: TP/SL hits, exit signals
└─ Decides: EXIT / HOLD

Configuration: Assembling Blocks

Strategies are defined in JSON files - no code changes needed:

Example: strategies/json/level-trading-single-ema.strategy.json

{
  "metadata": {
    "name": "Level Trading - Single EMA",
    "version": "2.0.0"
  },
  "entryThreshold": 40,

  "analyzers": [
    {
      "name": "EMA_ANALYZER_NEW",
      "enabled": true,
      "weight": 1.0,
      "priority": 1,
      "minConfidence": 0.35
    },
    {
      "name": "RSI_ANALYZER_NEW",
      "enabled": false,
      "weight": 0.5,
      "priority": 2
    },
    {
      "name": "DIVERGENCE_ANALYZER_NEW",
      "enabled": true,
      "weight": 0.8,
      "priority": 3
    }
  ],

  "indicators": {
    "ema": {
      "fastPeriod": 9,
      "slowPeriod": 21
    },
    "rsi": {
      "period": 14
    }
  }
}

What this does:

  1. Enables EMA Analyzer (100% weight - most important)
  2. Disables RSI Analyzer (not used in this strategy)
  3. Enables Divergence Analyzer (80% weight)
  4. Sets indicator periods specific to this strategy

Strategy Composition Example

strategy = "level-trading-single-ema"
    ↓
Load JSON configuration
    ↓
Instantiate:
  ├─ EMA Indicator (9/21 periods)
  ├─ RSI Indicator (14 period) - for divergence check
  ├─ EMA Analyzer (fast/slow crossover)
  └─ Divergence Analyzer (price/RSI mismatch)
    ↓
Market Update (new candle)
    ↓
Run Analysis:
  1. EMA Analyzer: "Fast EMA > Slow EMA? YES → LONG @ 0.75 confidence"
  2. Divergence Analyzer: "Price HH but RSI LH? YES → LONG @ 0.60 confidence"
  3. Other analyzers: DISABLED
    ↓
FilterOrchestrator:
  - Blind zone: Need 1 signal? YES, we have 2 ✅
  - Market flat? NO ✅
  - Volatility OK? YES ✅
    ↓
EntryOrchestrator:
  - Average confidence: (0.75 + 0.60) / 2 = 0.675
  - Above threshold (0.40)? YES ✅
  - Trend aligned? YES ✅
  - RiskManager approval? YES ✅
    ↓
Decision: OPEN LONG POSITION

Creating New Strategies

To create a new strategy, you don't modify code - you create a new JSON file:

# Copy template
cp strategies/json/level-trading.strategy.json \
   strategies/json/my-new-strategy.strategy.json

# Edit: Which analyzers to use, their weights, confidence thresholds
# Set indicator periods

# Run with new strategy:
# In config.json: "strategy": "my-new-strategy"
npm run dev

Adding New Analyzers

When you add a new analyzer (complete checklist):

  1. Create the analyzer class in src/analyzers/my-analyzer-new.ts

    • Extend from analyzer base pattern
    • Implement analyze(candles: Candle[]): AnalyzerSignal method
    • Return signal with direction (LONG/SHORT/HOLD), confidence (0-100), weight, priority
  2. Define type in config-new.types.ts

    • Create MyAnalyzerConfigNew interface extending BaseAnalyzerConfigNew
    • Add analyzer-specific parameters (e.g., thresholds, periods)
    • Export from types file
  3. Register in AnalyzerRegistry (src/services/analyzer-registry.service.ts)

    • Add analyzer to analyzerRegistry map with config merging logic
  4. Add defaults in config files

    • config.json: Add MY_ANALYZER_NEW entry to analyzerDefaults section
    • config.example.json: Add with full documentation comments
  5. Write tests

    • Technical tests: Verify analyzer logic and calculations
    • Functional tests: Test with real market patterns (uptrend, downtrend, reversals)
    • See src/__tests__/analyzers/ for examples
  6. Use in strategies via JSON config:

{
  "name": "MY_ANALYZER_NEW",
  "enabled": true,
  "weight": 0.5,
  "priority": 2,
  "param1": 14,
  "param2": 0.75
}

See MIGRATION_PLAN.md for phase-by-phase checklist of all 28 analyzers.

Data Flow: From Market to Trade

1. Market Event (candle closes)
   └─ TradingOrchestrator.onCandleClose()

2. Load Candles
   └─ CandleProvider.getCandles(1000)

3. Run Enabled Analyzers
   ├─ EMA Analyzer.analyze(candles)
   ├─ Divergence Analyzer.analyze(candles)
   └─ ... (only enabled ones)

4. Collect Signals
   └─ signals = [
      { analyzer: 'EMA', direction: 'LONG', confidence: 0.75 },
      { analyzer: 'DIV', direction: 'LONG', confidence: 0.60 }
    ]

5. Filter Signals
   └─ FilterOrchestrator.applyFilters(signals)

6. Evaluate Entry
   └─ EntryOrchestrator.evaluateEntry(filteredSignals)
      Returns: ENTER / SKIP / WAIT

7. Execute Trade (if ENTER)
   ├─ Calculate position size
   ├─ Place market order
   ├─ Set stop loss
   ├─ Queue take profits
   └─ Log to journal

8. Monitor Position
   ├─ Watch price updates
   ├─ Check TP/SL hits
   └─ Update PnL

9. Exit Trade
   └─ Position closed, profit/loss logged

Key Benefits of Building Blocks Design

Benefit Example
No Coding Change strategy by editing JSON
Reusability Same indicator powers multiple analyzers
Composability Mix 3, 10, or 25 analyzers - system adapts
Scalability Add new analyzers without touching orchestrators
Testability Each component tested independently
Flexibility Different strategies for different pairs/timeframes
Maintainability Changes to one analyzer don't break others

Testing

Unit Tests (2500+)

npm test                         # Run all tests
npm test -- --testNamePattern="PositionManager"  # Specific test

Test Coverage

  • Strategy logic (entry/exit conditions)
  • Indicator calculations
  • Position sizing and risk management
  • Order management
  • WebSocket handling
  • Market structure analysis

Troubleshooting

Config Loading Error

[ERROR] Cannot read properties of undefined (reading 'priceDiffPercent')

Solution: Ensure all required fields exist in config.json. Use config.example.json as template.

cp config.example.json config.json
# Then edit with your API keys

WebSocket Connection Failed

[ERROR] WebSocket connection failed

Causes & Solutions:

  • Check API keys are correct
  • Verify testnet setting matches your Bybit account
  • Check internet connection
  • Verify firewall isn't blocking connections

No Signals Generated

[INFO] No entry signals generated

Check:

  1. Historical data loaded (should see "Downloaded 1000 candles")
  2. Indicators calculated (RSI, EMA values in logs)
  3. Strategy enabled in config ("enabled": true)
  4. Market structure exists (not flat/consolidating)

Performance Expectations

Backtest Results (April 2024 - XRPUSDT 5m)

  • Win Rate: 33.3%
  • Avg Win: +0.85%
  • Avg Loss: -2.45%
  • Profit Factor: 1.8

Note: Past results ≠ future performance. Markets change constantly.


Data Files

The bot stores data in local SQLite database:

data/
├── market-data.db           # Candles, orderbook, trades
└── trading-journal.json     # Trade records

Download your first dataset:

npm run download-data XRPUSDT 2025-12-01 2025-12-31

Environment Variables

Create .env file (optional, for sensitive data):

# Bybit API (if not in config.json)
BYBIT_API_KEY=your_key_here
BYBIT_API_SECRET=your_secret_here
BYBIT_TESTNET=true

# Telegram notifications (optional)
TELEGRAM_BOT_TOKEN=your_token
TELEGRAM_CHAT_ID=your_chat_id

# Logging
LOG_LEVEL=info

Architecture Highlights

🧩 Building Blocks Design (No Coding Required)

Key Innovation: Compose trading strategies from pre-built components via JSON configuration

Strategy = Selection of Analyzers + Configuration
No coding needed - just edit JSON!

Benefits:

  • No Code Changes - Change strategies by editing JSON
  • Mix & Match Analyzers - Combine 3, 10, or 25 analyzers
  • Rapid Prototyping - Test new strategies in minutes
  • Easy Backtesting - Compare different analyzer combinations
  • Production Ready - Same system for testing and live trading

Example Workflow:

1. Choose analyzers: EMA + RSI + Divergence
2. Set weights: EMA 60%, RSI 30%, Divergence 10%
3. Define thresholds: Enter when confidence > 50%
4. Edit JSON file (no TypeScript needed!)
5. Run bot with new strategy

Type Safety & Fail-Fast Design

  • Full TypeScript strict mode - No any types allowed
  • ConfigNew type system - All config fields strictly typed
  • Compile-time validation - Type errors caught before runtime
  • Fail-fast approach - Missing config throws errors immediately
  • Runtime validation - Double-check config at startup

Modular Architecture

4-Layer System:

Layer 1: Indicators          → Pure math (6 indicators)
Layer 2: Analyzers          → Decision logic (29 analyzers)
Layer 3: Orchestrators      → Coordination (3 orchestrators)
Layer 4: Execution          → Place trades (40+ services)

Each layer is independent:

  • Change indicator implementation? Analyzers auto-adapt
  • Add new analyzer? Orchestrators use it automatically
  • Modify orchestrator? No impact on analyzers or indicators
  • Change service? No impact on analyzers

Extensibility Without Breaking Changes

Adding New Analyzer (5-step process):

  1. Create src/analyzers/my-new-analyzer-new.ts
  2. Register in AnalyzerRegistry (1 line)
  3. Use in strategy JSON:
    { "name": "MY_NEW_ANALYZER", "enabled": true, "weight": 0.5 }
  4. No other code changes needed
  5. Instant availability in all strategies

Adding New Indicator:

  1. Create src/indicators/my-new-indicator-new.ts
  2. Use in analyzers that need it
  3. Analyzers auto-update without changes
  4. Existing strategies still work

Comprehensive Testing

  • 2500+ unit tests - All components tested
  • Technical tests - Does the code work?
  • Functional tests - Does it behave correctly?
  • Real market patterns - Uptrend, downtrend, consolidation, reversals
  • Edge cases - Gaps, divergences, volatility spikes
  • Mock services - Test offline without API calls

Test Coverage by Component:

Indicators:    6 × 70+ tests each = 420+ tests
Analyzers:     29 × 54+ tests each = 1,600+ tests
Orchestrators: 3 × 50+ tests each = 150+ tests
Services:      50+ × 20+ tests = 1,000+ tests
Integration:   100+ tests
Total:         3,200+ tests

Performance Optimizations

  • Efficient candle processing - 1000+ candles/second
  • WebSocket subscriptions - Optimized feed management
  • Memory efficiency - Streaming candle updates
  • Lazy loading - Analyzers loaded on-demand
  • Caching - Indicator values cached between updates
  • Async operations - Non-blocking API calls

Code Organization & Maintainability

Separation of Concerns:

  • Indicators - Only calculate values (no trading logic)
  • Analyzers - Only generate signals (no execution logic)
  • Orchestrators - Only coordinate decisions (no order logic)
  • Services - Handle specific concerns (exchange, logging, etc.)

Benefits:

  • Easy to understand - Each file has single responsibility
  • Easy to test - Mock individual components
  • Easy to modify - Changes isolated to relevant layer
  • Easy to extend - Add new components without touching others

Production-Grade Code Quality

  • TypeScript strict mode - Full type safety
  • No code duplication - DRY principle throughout
  • Proper error handling - All edge cases covered
  • Comprehensive logging - Debug trading decisions
  • Configuration validation - Catch errors early
  • Git best practices - Clean history, security checks
  • Documentation - Every component documented

Contributing

While this is an educational project, we welcome:

  • Bug reports and fixes
  • Documentation improvements
  • Strategy enhancements
  • Test coverage additions

Please:

  1. Test thoroughly on testnet first
  2. Write tests for new features
  3. Follow existing code style
  4. Update documentation

Learning Resources

Smart Money Concepts

Recommended reading:

  • "Smart Money Concepts" trading principles
  • Support/resistance level identification
  • Risk management fundamentals
  • Technical analysis with SMC

Code Learning Path

  1. Start: Read src/strategies/level-based.strategy.ts (main logic)
  2. Then: Explore src/analyzers/ (entry signal generation)
  3. Then: Check src/services/ (position lifecycle)
  4. Finally: Study src/__tests__/ (test examples)

FAQ

Q: Which exchange does this bot work with? A: Bybit Futures ONLY. It will NOT work with other exchanges like Binance, Kraken, or others.

Q: Has this bot been tested on live accounts? A: NO! It has ONLY been tested on Bybit DEMO accounts. Real trading is NOT recommended.

Q: What if I switch to a real money account? A: You will almost certainly lose your entire deposit. The bot was NOT designed or tested for live trading.

Q: Can I use this on real money immediately? A: ABSOLUTELY NOT! You must:

  1. Start on Bybit DEMO account
  2. Run for 1-2 weeks minimum
  3. Even then, do NOT use real money unless you accept total loss

Q: What if the bot loses money? A: That's YOUR responsibility and YOUR LOSS. You use this AT YOUR OWN RISK. The author is NOT liable for any losses, liquidations, or negative balances.

Q: What will happen if I turn on live trading? A: Likely scenarios:

  • Your entire deposit will be wiped out
  • Your account will be liquidated
  • You may owe money to Bybit (negative balance = debt)
  • There is no safety net - this is your money

Q: Why does it sometimes not trade? A: Normal - the bot waits for high-confidence signals. Missing trades is GOOD - it's better than losing money.

Q: Can I modify the strategy? A: Yes! The code is designed to be modified. But backtest thoroughly AND test on demo first.

Q: How much capital do I need? A: For DEMO: Any amount to test. For REAL: Only use money you can afford to lose completely. Minimum Bybit account is ~$5-10, but do NOT put real money in this bot.


License

MIT License - See LICENSE file for details


Happy Testing on DEMO! 🚀 (NOT on live trading, of course!)

For questions or issues, open a GitHub issue.


🤝 Contributing

We welcome contributions! This project uses GitHub issues to organize work.

Good First Issues

Looking to contribute? Start with these easy tasks perfect for beginners:

  • good first issue - Tasks explicitly marked as beginner-friendly
    • Usually require 30 min - 1 hour
    • Well-documented requirements
    • Help you understand the codebase

Example: Add basic example to README, difficulty: easy, estimated 30 min

Help Wanted

For developers ready for a bigger challenge:

  • help wanted - Specific features or fixes we need
  • documentation - Improve docs, add examples, clarify code
  • enhancement - New features or improvements

How to Find Issues

Visit the Issues tab and filter by label:

  • good first issue - Perfect for beginners
  • help wanted - Medium complexity
  • documentation - Doc improvements
  • bug - Bug fixes
  • enhancement - New features

Contribution Process

  1. Pick an issue that interests you
  2. Comment on the issue to let us know you're working on it
  3. Create a branch from main
  4. Make your changes following the code style
  5. Write tests for your changes
  6. Submit a PR with a clear description
  7. Wait for review - we'll provide feedback

Development Setup

# Clone and install
git clone <repo>
cd Edison
npm install

# Run tests
npm test

# Run dev bot
npm run dev

# Run backtest
npm run backtest-v5 -- --strategy level-trading-v2

Code Style

  • TypeScript strict mode - No any types
  • Tests required - Technical + functional tests
  • Documentation - Comment non-obvious logic
  • Git commits - Clear, descriptive messages

Questions?

  • Check CLAUDE.md for project context
  • Check MIGRATION_PLAN.md for feature roadmap
  • Check SPEC.md files for detailed specs
  • Open an issue with question label

🤖 Built With Claude Code

This entire project demonstrates successful AI-assisted development:

This is not just a trading bot - it's a showcase of what's possible when working collaboratively with an advanced AI assistant (Claude Code). The entire architecture, implementation, testing, and documentation were designed and built with AI assistance.

What This Demonstrates:

  • Professional Architecture - Multi-layered system with proper separation of concerns
  • Comprehensive Testing - 2500+ unit tests with high coverage
  • Production-Grade Code - Full TypeScript strict mode, no any types
  • Real Exchange Integration - Live Bybit Futures V5 API
  • Advanced Algorithms - Smart Money Concepts strategies, multi-timeframe analysis
  • Risk Management Systems - Circuit breakers, position sizing, trailing stops
  • Complete Documentation - README, SPEC.md, 16+ specification files
  • Proper Version Control - Clean git history, security best practices

This proves that modern AI assistants can help build sophisticated financial systems - not by writing buggy code, but by collaborating on architecture, debugging, testing, and ensuring quality.



🏗️ How The Building Blocks System Works (Summary)

The 5-Second Overview

You write JSON (choose analyzers + set parameters)
↓
Edison loads your JSON strategy
↓
For each candle close:
  1. Run enabled analyzers → Get signals with confidence scores
  2. Filter signals → Apply trading rules
  3. Rank signals → Sort by confidence
  4. Decide → ENTER / SKIP / WAIT
  5. Execute → Place orders or skip
↓
Position monitored until TP/SL hit
↓
Repeat for next candle

What Makes It Special

Traditional Trading Bot:

// You have to code this yourself
if (fastEMA > slowEMA && RSI < 70 && ATR > X) {
  // Enter
  if (takeProfitHit) { Exit }
}

Edison Building Blocks:

{
  "analyzers": [
    { "name": "EMA_ANALYZER", "enabled": true, "weight": 0.6 },
    { "name": "RSI_ANALYZER", "enabled": true, "weight": 0.4 }
  ]
}

That's it! Edison handles the orchestration, signal ranking, filtering, and execution automatically.

⬆ Back to TOC


📋 Full Legal Disclaimer

THIS SOFTWARE IS PROVIDED FOR EDUCATIONAL PURPOSES ONLY

════════════════════════════════════════════════════════════════════════

🚨 EXCHANGE: BYBIT FUTURES ONLY
   - This bot is designed for Bybit Futures trading only
   - Tested and validated on Bybit testnet/demo accounts
   - May not work with other exchanges

🚨 TESTED ON DEMO ACCOUNTS ONLY
   - This bot has been tested EXCLUSIVELY on Bybit DEMO trading accounts
   - Demo results DO NOT guarantee live trading performance
   - Live market conditions differ significantly from demo
   - Real slippage, fees, and volatility impact results

🚨 TRADING WITH REAL MONEY = POTENTIAL TOTAL LOSS
   - Using this bot on LIVE trading accounts can and WILL result in:
     • Complete loss of your deposit
     • Rapid account liquidation
     • Negative balance (debt)
   - Markets are unpredictable and highly volatile
   - No guarantee of profitability under any conditions
   - Past performance ≠ future results

════════════════════════════════════════════════════════════════════════

EXPLICIT REQUIREMENTS:
✓ Test ONLY on Bybit TESTNET or DEMO accounts first
✓ Start with MINIMUM position sizes (even on demo)
✓ Monitor trades for at least 1-2 weeks before considering live
✓ Use minimal leverage (NOT 10x or 20x leverage)
✓ Risk ONLY money you can afford to lose completely
✓ If you trade live, your losses are YOUR RESPONSIBILITY

════════════════════════════════════════════════════════════════════════

LEGAL:
- NOT financial or investment advice
- NO warranty or guarantees of profitability
- Author assumes NO responsibility for financial losses
- Use at YOUR OWN RISK - full personal responsibility
- Author is NOT liable for losses, liquidations, or negative balances

════════════════════════════════════════════════════════════════════════

⛔ DO NOT USE WITH REAL MONEY UNLESS YOU FULLY ACCEPT:
   - You will likely lose your entire deposit
   - You may owe money to the exchange (negative balance)
   - No one will bail you out
   - This is YOUR decision and YOUR responsibility

If you do not accept these risks, DO NOT RUN THIS BOT.

⬆ Back to TOC


📄 License

This project is licensed under the MIT License - see LICENSE file for details.

MIT License Summary:

  • ✅ Free to use commercially
  • ✅ Free to modify and distribute
  • ✅ Minimal restrictions
  • ⚠️ Use at your own risk (no warranty)

⬆ Back to TOC


Last Updated: 2026-01-10 Version: 2.0.0 (Building Blocks Architecture) License: MIT Built With: Claude Code (Anthropic)