Note
This is a fully autonomous AI-powered crypto trading bot built in Rust. It utilizes Reinforcement Learning (RL) to optimize trading decisions. For educational purposes.
The AI Crypto Trading Bot leverages Deep Q-Networks (DQN) and technical indicators (RSI, MACD, Moving Averages) to execute trades with high efficiency. It supports experimental trading, backtesting, and risk management.
Warning
This bot is experimental. While it uses AI for decision-making, it is not guaranteed to be profitable. Use at your own risk! This bot has not been tested before, it is not even connected to any sort of exchange API. This is only for learning purposes.
- Fully Autonomous AI Trading - Uses RL to trade without manual intervention.
- Backtesting System - Simulates past trades to evaluate performance.
- Live Trading Mode - Executes real trades via exchange APIs. (Needs to be implemented)
- Multi-Indicator Strategy - Uses RSI, MACD, Moving Averages, and Support/Resistance.
- Risk Management - Implements stop-loss and take-profit.
- Rust (latest stable)
- Cargo package manager
- PostgreSQL (for trade history storage, check src/core/database/storage.rs)
git clone https://github.com/NEBYTE/RLTrading.git
cd RLTradingDATABASE_URL=postgres://user:password@localhost/trade_history
API_KEY= # BINANCE API KEY -> More exchanges will be implemented in the futurecargo build --releasecargo run --releaseTo evaluate AI performance on past market data:
cargo run --release -- backtest- Deep Q-Network (DQN)
- State → Market indicators (price, volume, RSI, MACD, moving average, etc.)
- Actions → Buy, Sell, Hold
- Reward Function → Based on profit/loss
- Moving Average Crossover (SMA/EMA)
- RSI & MACD Signals
- Support & Resistance Level Strategy
- Fear & Greed Index (TODO)
- Stop-Loss & Take-Profit
- Simulates trades on past market data
- Calculates total profit & win rate
- Stores results in PostgreSQL database
[dependencies]
tokio = { version = "1.28", features = ["full"] }
reqwest = { version = "0.11", features = ["json", "blocking"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tch = "0.19.0"
chrono = { version = "0.4", features = ["serde"]}
rust_decimal = "1.29"
sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "postgres", "macros"] }
log = "0.4"
env_logger = "0.10"Distributed under the GNU AGPLv3 license.