← Back to Plugins
Tools

Trading Assistant

XuXuClassMate By XuXuClassMate 👁 1 views ▲ 0 votes

OpenClaw Trading Assistant - A fully functional trading decision support system that provides technical analysis, buy/sell signals, position management, and risk monitoring.

Homepage GitHub

Install

npm install -g

README

# ๐Ÿš€ OpenClaw Trading Assistant

<div align="center">

**Version**: v1.3.1 (2026-03-25)  
**Author**: OpenClaw Community  
**License**: MIT

[๐Ÿ“š Docs Website](https://xuxuclassmate.github.io/trading-assistant/) โ€ข [Features](#-features) โ€ข [Installation](#-installation) โ€ข [Usage](#-usage)

---

### ๐ŸŒ Language / ่ฏญ่จ€

**[Switch to Chinese โ†’](README_zh.md)**

---

</div>

---

## ๐Ÿ“– Introduction

**OpenClaw Trading Assistant** is a complete trading decision support system that provides technical analysis, trading signals, position management, and risk monitoring.

### โœจ Key Features

- ๐Ÿ“Š **Support & Resistance Levels** - Automatic calculation with multiple algorithms
- ๐Ÿ“ˆ **Trading Signals** - Multi-indicator analysis (RSI, MACD, Moving Averages)
- ๐Ÿ’ฐ **Position Calculator** - Risk-based position sizing
- ๐ŸŽฏ **Stop Loss & Take Profit** - Price alerts and trigger detection
- โš ๏ธ **Risk Management** - Risk/Reward ratio, potential profit/loss
- ๐Ÿ”” **Notifications** - Feishu, DingTalk, Email (configurable)

### ๐ŸŽฏ Perfect For

- Stock/ETF investors
- Technical analysis enthusiasts
- Quantitative trading beginners
- OpenClaw users

---

## โœจ Features

### 1. Support & Resistance Levels

- Automatic calculation of key price levels
- Multiple algorithms: Previous High/Low, Moving Averages, Fibonacci, Pivot Points
- Strength indicator (strong/medium/weak)

**Example Output**:
```
NVDA Current Price: $175.64
Resistance: $177.26 (+0.9%), $180.00 (+2.5%)
Support: $175.00 (-0.4%), $171.72 (-2.2%)
```

---

### 2. Trading Signals

- Multi-indicator analysis (RSI, MACD, Moving Averages)
- Combined signal scoring
- Recommendations: Strong Buy / Buy / Hold / Sell / Strong Sell

**Example Output**:
```
RSI: 52.34 [Neutral]
MACD: 0.1234 [Bullish]
Moving Averages: [Bullish]
Combined: Bullish (score: 3)
Recommendation: BUY (Confidence: Medium)
```

---

### 3. Position Calculator

- Risk-based position sizing
- Risk profiles: Conservative / Moderate / Aggressive
- Confidence adjustment
- Stop-loss calculation
- Portfolio allocation

**Example Output**:
```
Total Capital: $100,000
Entry Price: $175.64
Stop Loss: $165.00
Risk Profile: Moderate

Position: 562 shares ($98,710, 98.7%)
Risk: $5,964 (5.96%)
Risk/Reward: 1:2.0
```

---

## ๐Ÿ› ๏ธ Installation

**๐Ÿ“š Complete guides**: https://xuxuclassmate.github.io/trading-assistant/guides/install-overview/

### Quick Comparison

| Method | Command | Time |
|--------|---------|------|
| **Docker** โญ | `docker run -it ghcr.io/xuxuclassmate/trading-assistant:latest` | 5 min |
| **pip** | `pip install openclaw-trading-assistant` | 10 min |
| **npm** | `npm install -g @xuxuclassmate/openclaw-trading-assistant` | 10 min |
| **Source** | `git clone + pip install -e .` | 15 min |

### Prerequisites

- Twelve Data API Key ([Get Free](https://twelvedata.com/pricing) - 800 calls/day)
- Alpha Vantage API Key ([Get Free](https://www.alphavantage.co/support/#api-key) - 25 calls/day)

### ๐Ÿณ Docker Installation (Recommended)

**Pull from GitHub Container Registry**:
```bash
docker pull ghcr.io/xuxuclassmate/trading-assistant:latest
```

**Pull from Docker Hub**:
```bash
docker pull xuxuclassmate/trading-assistant:latest
```

**Quick Start**:
```bash
# Create config directory
mkdir -p trading-assistant-config
cd trading-assistant-config

# Download example config
curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/.env.example
cp .env.example .env

# Edit .env with your API keys
nano .env  # or use your favorite editor

# Run the container
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest \
  --help
```

**Available Images**:
- `ghcr.io/xuxuclassmate/trading-assistant:1.2.0` - Specific version
- `ghcr.io/xuxuclassmate/trading-assistant:latest` - Latest stable
- `xuxuclassmate/trading-assistant:1.2.0` - Docker Hub (versioned)
- `xuxuclassmate/trading-assistant:latest` - Docker Hub (latest)

**Supported Platforms**: linux/amd64, linux/arm64

---

## ๐Ÿ–ฅ๏ธ CLI Usage

### ๐Ÿš€ Quick Start

```bash
# Start interactive mode (short & sweet!)
ta

# Full name also works
openclaw-trading-assistant
```

### ๐Ÿ“‹ Available Commands

| Command | Example | Description |
|---------|---------|-------------|
| `ta` | `ta` | Start interactive mode / ไบคไบ’ๆจกๅผ |
| `ta sr` | `ta sr` | Analyze support/resistance / ๅˆ†ๆžๆ”ฏๆ’‘้˜ปๅŠ›ไฝ |
| `ta sig` | `ta sig --symbol NVDA` | Generate signals / ็”Ÿๆˆไฟกๅท |
| `ta pos` | `ta pos --symbol NVDA --price 175 --capital 10000` | Calculate position / ่ฎก็ฎ—ไป“ไฝ |
| `ta alerts` | `ta alerts check` | Manage alerts / ็ฎก็†ๆ้†’ |
| `ta all` | `ta all` | Run all analysis / ่ฟ่กŒๆ‰€ๆœ‰ๅˆ†ๆž |
| `ta v` | `ta v` | Show version / ๆ˜พ็คบ็‰ˆๆœฌ |
| `ta h` | `ta h` | Show help / ๆ˜พ็คบๅธฎๅŠฉ |

### ๐Ÿ’ก Examples

**Interactive Mode**:
```bash
$ ta

============================================================
  OpenClaw Trading Assistant CLI
  Version: 1.3.0
============================================================

ta> help
ta> sig
ta> pos --symbol NVDA --price 175.64 --capital 10000
ta> exit
```

**Direct Commands**:
```bash
ta sr                      # Support/Resistance
ta sig                     # Signals for watchlist
ta sig --symbol NVDA       # Signals for specific stock
ta pos --symbol NVDA --price 175.64 --capital 10000
ta alerts check
ta all                     # Run everything
```

### ๐Ÿณ Docker CLI Usage

```bash
# Interactive mode in Docker
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest

# Direct command in Docker
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest \
  ta sig
```

---

## ๐ŸŒ Internationalization

**Default Language**: English (`en`)

**Switch Language**:

```bash
# Method 1: Environment Variable
export TRADING_ASSISTANT_LANG=zh_CN

# Method 2: In Code
from i18n import set_language
set_language("zh_CN")

# Method 3: Config File
# Add to config.json: {"language": "zh_CN"}
```

**Supported Languages**:
- English (`en`) - Default
- Chinese Simplified (`zh_CN`)

๐Ÿ“š [See I18N Documentation](docs/I18N.md)

---

## โš™๏ธ Configuration

### Required

1. **API Keys** - Twelve Data & Alpha Vantage
2. **Watchlist** - Your stock list

### Optional

1. **Notifications** - Feishu, DingTalk, Email (leave empty to disable)
2. **Risk Profile** - Conservative/Moderate/Aggressive
3. **Language** - English/Chinese

๐Ÿ“š [See Full Configuration Guide](docs/CONFIGURATION.md)

---

## ๐Ÿ“– Usage

### Basic Usage

```python
# Support & Resistance
from support_resistance import calculate_support_resistance
result = calculate_support_resistance("NVDA")

# Trading Signals
from trading_signals import generate_trading_signal
result = generate_trading_signal("AAPL")

# Position Calculation
from position_calculator import calculate_position_size
result = calculate_position_size(
    total_capital=100000,
    entry_price=175.64,
    stop_loss_price=165.00,
    risk_profile="moderate"
)
```

๐Ÿ“š [See Full Usage Guide](README_CLAWHUB.md)

---

## ๐Ÿ“ Project Structure

```
trading-assistant/
โ”œโ”€โ”€ config.py                    # Configuration
โ”œโ”€โ”€ i18n.py                      # Internationalization
โ”œโ”€โ”€ support_resistance.py        # Support/Resistance (Day 1)
โ”œโ”€โ”€ trading_signals.py           # Trading Signals (Day 1)
โ”œโ”€โ”€ position_calculator.py       # Position Calculator (Day 1)
โ”œโ”€โ”€ stop_loss_alerts.py          # Stop Loss & Take Profit (Day 2)
โ”œโ”€โ”€ locales/
โ”‚   โ”œโ”€โ”€ en.json                  # English translations
โ”‚   โ””โ”€โ”€ zh_CN.json               # Chinese translations
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ alerts/                  # Alert persistence (JSON)
โ”œโ”€โ”€ logs/                        # Log files
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ I18N.md                  # i18n documentation
โ”‚   โ”œโ”€โ”€ CONFIGURATION.md         # Configuration guide
โ”‚   โ”œโ”€โ”€ PUBLISHING.md            # Package publishing guide
โ”‚   โ””โ”€โ”€ V1.1.0_SUCCESS.md        # v1.1.0 release summary
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ”œโ”€โ”€ publish.yml          # Auto-publish workflow
โ”‚       โ””โ”€โ”€ publish-gh.yml       # GitHub Packages workflow
โ”œโ”€โ”€ scripts/                     # Utility scripts
โ”œโ”€โ”€ requirements.txt             # Dependencies
โ”œโ”€โ”€ pyproject.toml               # Python package config
โ”œโ”€โ”€ .env.example                 # Environment template
โ”œโ”€โ”€ watchlist.txt.example        # Watchlist template
โ”œโ”€โ”€ LICENSE                      # MIT License
โ”œโ”€โ”€ README.md                    # This file (English)
โ””โ”€โ”€ README_zh.md                 # Chinese version
```

---

## ๐Ÿงช Testing

```bash
# Test all modules
python3 support_resistance.py
python3 trading_signals.py
python3 position_calculator.py

# Run unit tests
python3 -m pytest tests/
```

---

## ๐Ÿ“Š Version History

### v1.1.0 (2026-03-24) - Stop Loss & Take Profit Alerts

**New Features**:
- โœ… Stop Loss & Take Profit alert system
- โœ… Automatic price trigger detection
- โœ… Risk/Reward ratio calculation
- โœ… Potential profit/loss estimation
- โœ… JSON-based alert persistence
- โœ… Detailed logging

**Files Added**:
- `stop_loss_alerts.py` - Alert management module
- `data/alerts/` - Alert data storage
- `logs/` - Log file directory

**Usage Example**:
```python
from stop_loss_alerts import StopLossAlert, calculate_stop_loss_levels

# Calculate levels
levels = calculate_stop_loss_levels(
    entry_price=175.64,
    stop_loss_percent=5.0,
    take_profit_percent=10.0
)

# Create alert
alert = StopLossAlert("NVDA", 175.64)
alert.create_alert(
    entry_price=175.64,
    stop_loss_price=levels['stop_loss_price'],
    take_profit_price=levels['take_profit_price'],
    shares=100
)
```

---

### v1.0.0 (2026-03-24) - Initial Release

**Features**:
- โœ… Support & Resistance calculation
- โœ… Trading signal generation (RSI, MACD, MA)
- โœ… Position size calculator
- โœ… Multi-language support (EN/ZH)
- โœ… Configurable notifications
- โœ… Portfolio allocation

๐Ÿ“š [See Full Release Notes](CHANGELOG.md)

---

## โš ๏ธ Disclaimer

This s

... (truncated)
tools

Comments

Sign in to leave a comment

Loading comments...