Trading bot canggih untuk cryptocurrency exchange Indodax dengan integrasi Machine Learning, AI enhancement (Claude API), dan auto-trading. Bot ini menggunakan analisis teknikal multi-timeframe, ML models V3/V4, dan AI reasoning untuk menghasilkan signal trading berkualitas tinggi.
- Technical Analysis: RSI, MACD, Bollinger Bands, ATR, ADX, Volume analysis
- Multi-Timeframe: 1m, 5m, 15m, 1h untuk analisis komprehensif
- ML Models: 3 versi ML model (V2, V3 dengan backtesting, V4 trade outcome-based)
- AI Enhancement: Integrasi Claude API untuk reasoning & confidence adjustment
- Signal Quality Engine: Scoring 0-100 dengan risk/reward validation
- Support/Resistance Detection: Automatic S/R level detection
- Auto Buy/Sell: Eksekusi otomatis berdasarkan signal berkualitas tinggi
- Risk Management: Portfolio exposure limit, position sizing, max concurrent positions
- Market Regime Detection: Trending/Ranging/Volatile/Choppy detection
- Auto-Sell Monitoring: Take profit, stop loss, trailing stop automation
- Dry-Run Mode: Simulasi trading tanpa risiko
- Scalper Module: High-frequency trading untuk profit 0.5-2%
- Smart Hunter: Momentum hunting untuk low-cap coins (target 3-5%)
- Ultra Hunter: Aggressive hunting untuk extreme opportunities (target 5-10%)
- 93 Commands: Lengkap untuk monitoring, trading, dan management
- Inline Keyboards: Interactive UI untuk quick actions
- Real-time Notifications: Signal alerts, trade confirmations, portfolio updates
- Notification Filters: BUY-only, SELL-only, actionable, atau all signals
- Redis Caching: Price cache, state management, task queue
- SQLite Database: Signals, trades, positions, performance metrics
- Background Workers: Async workers, price polling, signal queue
- WebSocket: Real-time price updates dari Indodax
Untuk navigasi codebase yang efisien, ikuti layered read approach:
π SYSTEM_MAP.md - Module index, dependencies, entry points
- Baca ini PERTAMA untuk memahami arsitektur
- Indeks lengkap semua modul (core, analysis, autotrade, signals, dll)
- Dependencies tree & critical paths
- Quick navigation commands
π OPERATIONS_FLOW_ALGORITHMA.md - Runtime flows & algorithms
- Startup sequence detail
- Signal generation pipeline (8 steps)
- Auto-trading flow dengan validation gates
- Market regime detection
- Test policy per modul
π COMMAND_REFERENCE.md - Telegram commands & callbacks
- Complete reference 93 commands
- Organized by category (signals, trading, portfolio, dll)
- Callback handlers & inline keyboards
- Error handling policies
π DOCUMENTATION_RULES.md - Code quality & best practices
- Mandatory file header format
- Docstring standards
- Naming conventions
- Error handling & logging
- Git commit message format
- Anti-patterns to avoid
Setelah baca 4 layer di atas, baru baca kode spesifik yang dibutuhkan:
# Cari fungsi/class dengan grep
grep -rn "class SignalEnhancementEngine" advanced_crypto_bot/
# Read snippet Β±20 baris di sekitar target
# Jangan read full file besar!# Python 3.9+
python3 --version
# Redis server
redis-server --version
# TA-Lib (for technical indicators)
# Install dari source atau package manager# Clone repository
git clone https://github.com/akwsa/advanced_crypto_bot.git
cd advanced_crypto_bot
# Install dependencies
pip install -r requirements.txt
# Setup TA-Lib (jika belum)
# Ubuntu/Debian:
sudo apt-get install ta-lib
# macOS:
brew install ta-lib# Copy .env.example ke .env
cp .env.example .env
# Edit .env dengan API keys Anda:
# - TELEGRAM_BOT_TOKEN (dari @BotFather)
# - INDODAX_API_KEY & INDODAX_SECRET_KEY
# - ANTHROPIC_API_KEY (Claude API)
# - REDIS_HOST & REDIS_PORT# Start Redis (terminal 1)
redis-server
# Start bot (terminal 2)
cd advanced_crypto_bot
python3 bot.py1. Buka Telegram, cari bot Anda
2. /start - Mulai bot
3. /watch btcidr - Watch Bitcoin
4. /signal btcidr - Generate signal
5. /help - Lihat semua commands
/watch btcidr ethidr dogebidr
/signals
β Bot akan generate signals untuk semua watched pairs
/add_autotrade btcidr
/list_autotrade
/start_trading
β Bot akan auto-trade untuk pairs yang ditambahkan
/notif_buy
β Hanya notif BUY signals (filter SELL & HOLD)
/notif_status
β Cek notification settings
/balance
β Cek saldo Indodax
/portfolio
β Lihat holdings
/performance
β P&L, win rate, total trades
/s_menu
β Scalper main menu
/s_analisa btcidr
β Analisa scalping opportunity
/s_posisi
β Lihat scalp positions
advanced_crypto_bot/
βββ π§ core/ # Config, Database, Logger, Utils
βββ π analysis/ # Technical Analysis, ML Models (V2/V3/V4)
βββ πΉ autotrade/ # Trading Engine, Risk Manager, Portfolio
βββ π― autohunter/ # Smart & Ultra Profit Hunters
βββ β‘ scalper/ # Scalping Module
βββ π‘ signals/ # Signal Pipeline, Quality Engine, Formatter
βββ π api/ # Indodax API, WebSocket
βββ πΎ cache/ # Redis Price Cache, State Manager
βββ π· workers/ # Background Workers, Price Poller
βββ π€ bot_parts/ # Telegram UI, Charts, Formatting
βββ π§ͺ tests/ # Unit & Integration Tests
βββ π monitoring/ # Runtime Observers
Entry Point: bot.py (AdvancedCryptoBot class)
Key Flows:
- Signal: Price Update β Signal Pipeline β TA + ML + AI β Quality Check β Telegram
- Trading: Signal β Risk Validation β Market Regime Check β Order Execution β Portfolio Update
- Auto-Sell: Position Monitor β P&L Check β TP/SL Trigger β Sell Order β DB Update
# Test specific module
pytest tests/test_scalper_dryrun_positions.py -v
# Test signal pipeline
pytest tests/test_v4_integration.py -v
# Test safety
pytest tests/test_dryrun_safety.py -v
# Full test suite
pytest tests/ -v --cov=advanced_crypto_botTest Policy: Lihat OPERATIONS_FLOW_ALGORITHMA.md β Test Policy section
# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
# Indodax API
INDODAX_API_KEY=your_api_key
INDODAX_SECRET_KEY=your_secret_key
# Claude API (AI Enhancement)
ANTHROPIC_API_KEY=your_anthropic_key
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# Trading Parameters
MIN_CONFIDENCE=0.55
MIN_QUALITY_SCORE=60
MAX_POSITIONS=3
RISK_PER_TRADE=0.10- Phase 1: Baseline rules & reject filters β
PHASE1_BASELINE_AND_REJECT_RULES.md - Phase 2: Advanced rule implementation β
PHASE2_RULE_IMPLEMENTATION_SPEC.md
- JANGAN commit
.envke Git (sudah ada di.gitignore) - JANGAN share API keys di public
- Gunakan dry-run mode untuk testing sebelum live trading
- Set position limits sesuai risk tolerance
- Monitor portfolio secara berkala
Signal Quality:
- Confidence threshold: 55%+
- Quality score: 60-100
- Risk/Reward ratio: >1.5
- AI enhancement: Claude API reasoning
Auto-Trading:
- Max exposure: 30% per trade
- Max concurrent positions: 3
- Default risk: 10% of capital
- Take profit: Dynamic based on volatility
- Stop loss: Based on S/R levels
Scalper:
- Target profit: 0.5-2%
- Stop loss: <0.5%
- Timeframe: <5 min
- High volume requirement
# 1. Baca SYSTEM_MAP.md
cat SYSTEM_MAP.md
# 2. Grep untuk lokasi kode
grep -rn "class TradingEngine" advanced_crypto_bot/
# 3. Read snippet (jangan full file!)
# Gunakan offset untuk read Β±20 baris saja
# 4. Edit dengan patch kecil
# Gunakan edit tool, jangan rewrite full file
# 5. Test fokus (bukan full suite)
pytest tests/test_<module>.py
# 6. Update docs canonical jika perlu# Format commit message (lihat DOCUMENTATION_RULES.md)
git commit -m "feat: add new feature
Description...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"- Technical Analysis (TA-Lib)
- ML Models V2/V3/V4
- AI Enhancement (Claude API)
- Auto-Trading Engine
- Risk Management
- Scalper Module
- Hunter Modules (Smart & Ultra)
- Telegram Bot (93 commands)
- Redis Caching
- Signal Quality Engine
- Web Dashboard (TMA)
- Backtesting UI
- Multi-exchange support
- Advanced ML models (V5 dengan deep learning)
- Portfolio rebalancing automation
Contributions welcome! Please:
- Read DOCUMENTATION_RULES.md untuk coding standards
- Buat branch:
git checkout -b feature/nama-fitur - Commit dengan format yang benar
- Update docs canonical jika perlu
- Submit PR dengan deskripsi jelas
MIT License - See LICENSE file
- TA-Lib: Technical analysis library
- Python Telegram Bot: Telegram bot framework
- Anthropic Claude: AI enhancement
- Indodax: Indonesian crypto exchange
- Redis: Caching & state management
TRADING CRYPTOCURRENCY MEMILIKI RISIKO TINGGI!
Bot ini disediakan "as-is" tanpa warranty. Gunakan dengan risiko Anda sendiri:
- Hanya trade dengan uang yang sanggup Anda kehilangan
- Selalu gunakan dry-run mode untuk testing
- Set position limits yang konservatif
- Monitor portfolio secara aktif
- Pahami risiko market volatility
Author tidak bertanggung jawab atas kerugian trading.
- Issues: GitHub Issues
- Docs: Baca canonical docs di repository
- Email: wkagung@gmail.com
Happy Trading! ππ
Built with β€οΈ using Python, ML, and AI