Metadata-Version: 2.4
Name: trademind-ai
Version: 2.0.3
Summary: TradeMind AI — Asistente de Análisis Financiero con IA
Home-page: https://trademind.ai
Author: TradeMind AI
Keywords: trading bot ai crypto polymarket kalshi signals
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: websockets>=12.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: aiofiles>=23.2.1
Requires-Dist: sqlalchemy>=2.0.23
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: aiohttp>=3.9.1
Requires-Dist: requests>=2.30.0
Requires-Dist: beautifulsoup4>=4.12.2
Requires-Dist: lxml>=4.9.4
Requires-Dist: feedparser>=6.0.11
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: ta>=0.10.2
Requires-Dist: scipy>=1.11.4
Requires-Dist: ccxt>=4.1.77
Requires-Dist: yfinance>=0.2.36
Requires-Dist: openai>=1.6.1
Requires-Dist: apscheduler>=3.10.4
Requires-Dist: plyer>=2.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: pydantic-settings>=2.1.0
Requires-Dist: rich>=13.7.0
Requires-Dist: pyyaml>=6.0.1
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 🤖 TradeMind AI — BTC Bot para Polymarket

**Versión 2.0** | Análisis de Mercados de Predicción en Tiempo Real

---

## ⚠️ ADVERTENCIA IMPORTANTE

**Este software NO es un asesor financiero.** Las señales son SUGERENCIAS basadas en indicadores técnicos. Usted es responsable de sus decisiones. NUNCA apueste dinero que no pueda perder.

> 📄 Lea el [DISCLAIMER completo](DISCLAIMER.md) antes de usar el software.

---

## 🚀 Instalación para Compradores (compraste una key)

Tienes **3 opciones** según tu nivel técnico:

### Opción A — Doble click (la más fácil) 👍
1. Descarga el instalador: <https://trademind-bot.vercel.app/downloads/install.bat> (Windows) o <https://trademind-bot.vercel.app/downloads/install.sh> (Mac/Linux)
2. Si estás en **Mac/Linux**, primero hace: `chmod +x install.sh`
3. **Doble click** (o ejecuta en terminal: Windows: `install.bat` / Mac-Linux: `./install.sh`)
4. Pega tu key cuando te la pida
5. Listo, el navegador se abre con el bot

> 💡 **Truco para Mac/Linux sin descargar nada:**
> ```bash
> curl -sSL https://trademind-bot.vercel.app/downloads/install.sh | bash
> ```
> Eso descarga, le da permisos, y ejecuta en un solo paso.

### Opción B — Una línea en la terminal
```bash
pip install https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
trademind activate TU-KEY-XXX-XXX-XXX-XX
trademind
```

### Opción C — Si TradeMind AI está publicado en PyPI
```bash
pip install trademind-ai
trademind activate TU-KEY-XXX-XXX-XXX-XX
trademind
```

> 📦 **Para activar**: las keys tienen formato `XXX-XXX-XXX-XX` (11 dígitos con checksum). Las que venías usando de 9 dígitos también funcionan.

---

## 🛠 Instalación para Desarrolladores (instalar el código fuente)

### Requisitos

- **Python 3.10+**
- **Windows / Mac / Linux**
- Conexión a Internet

### Build local

```bash
# 1. Clonar el repo
git clone https://github.com/tu-usuario/trademind-ai.git
cd trademind-ai

# 2. Build del paquete (genera dist/trademind_ai-X.Y.Z-py3-none-any.whl)
python -m build

# 3. Instalar tu build local
pip install -e .

# 4. Publicar a PyPI (cuando estés listo)
python -m twine upload dist/*
```

---

## 🎯 ¿Qué hace TradeMind AI?

| Funcionalidad | Descripción |
|---|---|
| **BTC Bot** | Analiza mercados "Bitcoin Up/Down" de 15 y 5 minutos |
| **Veredicto** | UP / DOWN / SIN SEÑAL basado en 7 indicadores técnicos |
| **Gráfica TradingView** | BTC/USD interactiva con timeframes 1m-1W |
| **Predicciones** | Probabilidad estimada para cada ventana de Polymarket |
| **Kelly Criterion** | Tamaño de apuesta óptimo basado en bankroll y edge |
| **Auto-Trading** | El bot puede apostar automáticamente (PAPEL o REAL) |
| **TP/SL** | Take Profit +25% / Stop Loss -50% automático |
| **Emergency Stop** | Botón para cerrar todas las posiciones al instante |

---

## 📦 Publicar el paquete (para el dueño)

Si sos el dueño y querés publicar `trademind-ai` a PyPI (la opción C para compradores):

```bash
# Una sola vez: crear cuenta en https://pypi.org/account/register/
#   - Habilitar 2FA
#   - Crear API token en https://pypi.org/manage/account/token/

# Cada vez que lanzás nueva versión:
cd trademind-ai
# 1. Bump version en trademind/__version__.py
# 2. Build
python -m build
# 3. Publish (te pide username = __token__ y password = tu API token)
python -m twine upload dist/*
# 4. Verificar que quedó
pip install --upgrade trademind-ai
```

Una vez publicado, los compradores pueden hacer `pip install trademind-ai` y todos los updates vienen con `pip install --upgrade trademind-ai`. `setup.py` ya incluye `README.md` como `long_description` automáticamente, así que `twine` sube todo lo necesario en una sola corrida.

---

## 🕹️ Modos de Uso

### 🎭 Modo PAPEL (RECOMENDADO)
- Simula operaciones sin dinero real
- Ideal para probar el bot y ver resultados históricos
- Mismo panel de control, sin riesgo

### 💀 Modo REAL (EXPERIMENTAL)
- **REQUIERE**: Wallet de Polygon con USDC y MATIC
- **REQUIERE**: Llave privada (¡NUNCA la comparta!)
- El bot ejecuta órdenes reales en Polymarket CLOB
- **ALTO RIESGO de pérdida total**

---

## 📊 Panel de Control

Al abrir `http://localhost:3000` → BTC Bot, verá:

```
COLUMNA IZQUIERDA:
├── 🎯 Veredicto UP/DOWN con confianza
├── 💰 Bankroll y apuesta sugerida (Kelly)
├── 📈 Gráfica TradingView interactiva
├── 📊 Señal de Trading con Stop Loss / Take Profit
├── 📉 Predicciones en Vivo (4-6 ventanas)
└── 🎯 Mercados monitoreados

COLUMNA DERECHA:
├── ⚙️ Configuración del Bot
├── 🤖 TRADING AUTOMÁTICO ← NUEVO
│   ├── Selector PAPEL / REAL
│   ├── Balance, P&L, Posiciones
│   ├── [▶ Iniciar Auto-Trading]
│   └── [🛑 STOP]
└── 🚨 Advertencias
```

---

## 🔧 Configuración Manual

Para iniciar sin el wizard:

```bash
python main.py
# Abre http://localhost:3000
```

---

## 📜 Licencia

Este software se distribuye "TAL CUAL", sin garantías. Consulte [DISCLAIMER.md](DISCLAIMER.md).

---

## 🤝 Soporte

TradeMind AI es un proyecto independiente. Para preguntas o sugerencias, abra un issue en el repositorio.

---

## 🔁 Deploy de los installers (PASO OBLIGATORIO antes de vender)

Los archivos en `frontend/public/downloads/` solo están vivos cuando Vercel los publica. Si ya tenés tu sitio en Vercel, los pasos son:

```bash
# Opción git (auto-deploy)
git add frontend/public/downloads/
git commit -m "Add v2.0.0 installers + wheel for buyers"
git push origin main
# Vercel auto-deploys → https://trademind-bot.vercel.app/downloads/install.bat queda vivo

# Opción CLI (deploy directo)
npx vercel --prod --token=tu-token-aqui
```

Después de eso, los compradores pueden bajar los installers desde tu sitio. Verifica con:

```bash
curl -I https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
# Debe responder HTTP/2 200
```

Para lanzar v2.1: bumpeá `trademind/__version__.py`, rebuild (`python -m build`), repetí el deploy — los compradores existentes pueden actualizar con `pip install --upgrade trademind-ai` (si publicaste) o `pip install --upgrade https://trademind-bot.vercel.app/downloads/trademind_ai-2.1.0-py3-none-any.whl`.

---

## 🚀 Despliegue a producción

La app está lista para deployarse como **frontend estático en Netlify + backend FastAPI en Render.com** (ambos con plan free). Archivos de configuración ya incluidos en el repo:

| Archivo | Propósito |
|---|---|
| `frontend/netlify.toml` | Build + SPA fallback + cache headers |
| `frontend/public/_redirects` | SPA fallback belt+suspenders |
| `Dockerfile` | Backend image para Render/Railway/Fly |
| `render.yaml` | One-click deploy backend en Render (incluye disco persistente para SQLite) |
| `.env.production.example` | Checklist de env vars obligatorios |

### Paso 1: Backend en Render
1. Subí el repo a GitHub
2. en render.com → New → Blueprint → apuntá a tu repo
3. Render detecta `render.yaml` y crea todo: el web service + disco persistente de 1GB en `/app/data`
4. En el panel Environment, copiá los valores de `.env.production.example` y rellenálos:
   - `TRADEMIND_ADMIN_HASH` (generá con `python -c "import hashlib,sys;print(hashlib.sha256(sys.argv[1].encode()).hexdigest())" 'tu-clave'`)
   - `TRADEMIND_RESEND_API_KEY` + `TRADEMIND_RESEND_FROM` (ya configurados previamente)
   - `TRADEMIND_ALLOWED_ORIGINS=https://TU-SITIO.netlify.app`
5. Esperá el primer deploy (~5 min). Anotá la URL: `https://trademind-backend.onrender.com`

### Paso 2: Frontend en Netlify
1. en netlify.com → Add new site → Import from Git
2. Build command: `CI=false npm run build` (ya está en netlify.toml)
3. Publish directory: `build`
4. En Site settings → Environment variables, agregá:
   - `REACT_APP_API_BASE_URL` = `https://trademind-backend.onrender.com`
5. Deploy. Tu página queda en `https://TU-SITIO.netlify.app`

### ⚠️ Cosas a saber del free tier
- **Render spin-down**: el servicio se duerme a los 15min sin tráfico. El primer request tarda ~30s en despertar (es normal, mostrale un loading).
- **CORS**: si Netlify te da un subdominio distinto al que pusiste en `TRADEMIND_ALLOWED_ORIGINS`, los requests van a fallar. Verificá que coincidan exacto.

Para más detalles, consultá `SECURITY.md` (postura securidad) y `.freebuff/run.md` (procedimientos de operación local).

---

*Hecho con ❤️ para traders que entienden el riesgo.*
