File size: 1,856 Bytes
fc115d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: DRL Trading Bot
emoji: πŸ€–
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.42.0
app_file: src/ui/app.py
pinned: false
---

# DRL Trading System

An autonomous Deep Reinforcement Learning trading system using PPO-LSTM for Binance Testnet trading with real-time Streamlit monitoring.

## Features

- 🧠 **PPO-LSTM Agent**: Captures time-series dependencies for smarter trading decisions
- πŸ”„ **Self-Improvement Loop**: Automatically fine-tunes on successful trades every 24 hours
- πŸ“Š **Real-time Dashboard**: TradingView-style charts with live Buy/Sell signals
- πŸ›‘οΈ **Risk Management**: Circuit breaker stops trading at 5% daily loss
- πŸ“ˆ **Backtesting**: Validated on 2024-2025 historical data

## Quick Start

```bash
# 1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 2. Install dependencies
pip install -r requirements.txt

# 3. Configure API keys
cp .env.example .env
# Edit .env with your Binance Testnet credentials

# 4. Run backtest first
python -m src.backtest.engine

# 5. Launch UI
streamlit run src/ui/app.py
```

## Project Structure

```
drl-trading-system/
β”œβ”€β”€ config/
β”‚   └── config.yaml          # All configuration
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ env/                  # Gymnasium environment
β”‚   β”œβ”€β”€ brain/                # PPO-LSTM agent
β”‚   β”œβ”€β”€ api/                  # Binance connector
β”‚   β”œβ”€β”€ backtest/             # Backtesting engine
β”‚   └── ui/                   # Streamlit dashboard
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ historical/           # Cached OHLCV data
β”‚   └── models/               # Saved checkpoints
└── tests/
```

## Architecture

The system uses a Sharpe/Sortino ratio reward function to prioritize risk-adjusted returns over raw profit.

## License

MIT