trademind-ai 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. trademind_ai-2.0.0/PKG-INFO +296 -0
  2. trademind_ai-2.0.0/README.md +243 -0
  3. trademind_ai-2.0.0/backend/__init__.py +1 -0
  4. trademind_ai-2.0.0/backend/ai/__init__.py +1 -0
  5. trademind_ai-2.0.0/backend/ai/ai_service.py +596 -0
  6. trademind_ai-2.0.0/backend/ai/ai_trader.py +653 -0
  7. trademind_ai-2.0.0/backend/api/__init__.py +1 -0
  8. trademind_ai-2.0.0/backend/api/routes.py +1731 -0
  9. trademind_ai-2.0.0/backend/backtesting/__init__.py +1 -0
  10. trademind_ai-2.0.0/backend/backtesting/backtesting_engine.py +490 -0
  11. trademind_ai-2.0.0/backend/btc_bot/__init__.py +1 -0
  12. trademind_ai-2.0.0/backend/btc_bot/btc_bot_service.py +2085 -0
  13. trademind_ai-2.0.0/backend/data/__init__.py +3 -0
  14. trademind_ai-2.0.0/backend/data/economic_calendar.py +210 -0
  15. trademind_ai-2.0.0/backend/data/market_data.py +204 -0
  16. trademind_ai-2.0.0/backend/data/news_service.py +209 -0
  17. trademind_ai-2.0.0/backend/data/real_data_fetcher.py +532 -0
  18. trademind_ai-2.0.0/backend/data/sentiment_service.py +281 -0
  19. trademind_ai-2.0.0/backend/data/social_feed_service.py +466 -0
  20. trademind_ai-2.0.0/backend/indicators/__init__.py +1 -0
  21. trademind_ai-2.0.0/backend/indicators/technical_indicators.py +558 -0
  22. trademind_ai-2.0.0/backend/kalshi/__init__.py +1 -0
  23. trademind_ai-2.0.0/backend/kalshi/kalshi_service.py +174 -0
  24. trademind_ai-2.0.0/backend/models/__init__.py +2 -0
  25. trademind_ai-2.0.0/backend/models/database.py +109 -0
  26. trademind_ai-2.0.0/backend/models/models.py +308 -0
  27. trademind_ai-2.0.0/backend/polymarket/__init__.py +1 -0
  28. trademind_ai-2.0.0/backend/polymarket/polymarket_service.py +328 -0
  29. trademind_ai-2.0.0/backend/polymarket/polymarket_trader.py +691 -0
  30. trademind_ai-2.0.0/backend/server.py +239 -0
  31. trademind_ai-2.0.0/backend/services/__init__.py +1 -0
  32. trademind_ai-2.0.0/backend/services/alert_service.py +128 -0
  33. trademind_ai-2.0.0/backend/services/email_service.py +866 -0
  34. trademind_ai-2.0.0/backend/services/geoip.py +105 -0
  35. trademind_ai-2.0.0/backend/services/license_service.py +549 -0
  36. trademind_ai-2.0.0/backend/services/polymarket_verifier.py +150 -0
  37. trademind_ai-2.0.0/backend/services/purchase_service.py +593 -0
  38. trademind_ai-2.0.0/backend/test_real_sources.py +80 -0
  39. trademind_ai-2.0.0/backend/test_sentiment_api.py +45 -0
  40. trademind_ai-2.0.0/backend/websocket/__init__.py +0 -0
  41. trademind_ai-2.0.0/setup.cfg +4 -0
  42. trademind_ai-2.0.0/setup.py +214 -0
  43. trademind_ai-2.0.0/trademind/__init__.py +8 -0
  44. trademind_ai-2.0.0/trademind/__version__.py +14 -0
  45. trademind_ai-2.0.0/trademind/cli.py +630 -0
  46. trademind_ai-2.0.0/trademind/license_client.py +181 -0
  47. trademind_ai-2.0.0/trademind/static/build/_redirects +9 -0
  48. trademind_ai-2.0.0/trademind/static/build/asset-manifest.json +13 -0
  49. trademind_ai-2.0.0/trademind/static/build/downloads/install.bat +122 -0
  50. trademind_ai-2.0.0/trademind/static/build/downloads/install.sh +120 -0
  51. trademind_ai-2.0.0/trademind/static/build/downloads/trademind_ai-2.0.0-py3-none-any.whl +0 -0
  52. trademind_ai-2.0.0/trademind/static/build/downloads/trademind_ai-2.0.0.tar.gz +0 -0
  53. trademind_ai-2.0.0/trademind/static/build/index.html +1 -0
  54. trademind_ai-2.0.0/trademind/static/build/manifest.webmanifest +31 -0
  55. trademind_ai-2.0.0/trademind/static/build/static/css/main.ed42a01c.css +4 -0
  56. trademind_ai-2.0.0/trademind/static/build/static/css/main.ed42a01c.css.map +1 -0
  57. trademind_ai-2.0.0/trademind/static/build/static/js/main.cb6af7c1.js +3 -0
  58. trademind_ai-2.0.0/trademind/static/build/static/js/main.cb6af7c1.js.LICENSE.txt +39 -0
  59. trademind_ai-2.0.0/trademind/static/build/static/js/main.cb6af7c1.js.map +1 -0
  60. trademind_ai-2.0.0/trademind/updater.py +143 -0
  61. trademind_ai-2.0.0/trademind_ai.egg-info/PKG-INFO +296 -0
  62. trademind_ai-2.0.0/trademind_ai.egg-info/SOURCES.txt +64 -0
  63. trademind_ai-2.0.0/trademind_ai.egg-info/dependency_links.txt +1 -0
  64. trademind_ai-2.0.0/trademind_ai.egg-info/entry_points.txt +3 -0
  65. trademind_ai-2.0.0/trademind_ai.egg-info/requires.txt +25 -0
  66. trademind_ai-2.0.0/trademind_ai.egg-info/top_level.txt +2 -0
@@ -0,0 +1,296 @@
1
+ Metadata-Version: 2.4
2
+ Name: trademind-ai
3
+ Version: 2.0.0
4
+ Summary: TradeMind AI — Asistente de Análisis Financiero con IA
5
+ Home-page: https://trademind.ai
6
+ Author: TradeMind AI
7
+ Keywords: trading bot ai crypto polymarket kalshi signals
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Financial and Insurance Industry
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Office/Business :: Financial :: Investment
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: fastapi>=0.104.0
20
+ Requires-Dist: uvicorn[standard]>=0.24.0
21
+ Requires-Dist: websockets>=12.0
22
+ Requires-Dist: python-multipart>=0.0.6
23
+ Requires-Dist: aiofiles>=23.2.1
24
+ Requires-Dist: sqlalchemy>=2.0.23
25
+ Requires-Dist: aiosqlite>=0.19.0
26
+ Requires-Dist: httpx>=0.25.0
27
+ Requires-Dist: aiohttp>=3.9.1
28
+ Requires-Dist: beautifulsoup4>=4.12.2
29
+ Requires-Dist: lxml>=4.9.4
30
+ Requires-Dist: feedparser>=6.0.11
31
+ Requires-Dist: numpy>=1.24.0
32
+ Requires-Dist: pandas>=2.0.0
33
+ Requires-Dist: ta>=0.10.2
34
+ Requires-Dist: ccxt>=4.1.77
35
+ Requires-Dist: yfinance>=0.2.36
36
+ Requires-Dist: openai>=1.6.1
37
+ Requires-Dist: apscheduler>=3.10.4
38
+ Requires-Dist: plyer>=2.1.0
39
+ Requires-Dist: python-dotenv>=1.0.0
40
+ Requires-Dist: pydantic>=2.5.0
41
+ Requires-Dist: pydantic-settings>=2.1.0
42
+ Requires-Dist: rich>=13.7.0
43
+ Requires-Dist: pyyaml>=6.0.1
44
+ Dynamic: author
45
+ Dynamic: classifier
46
+ Dynamic: description
47
+ Dynamic: description-content-type
48
+ Dynamic: home-page
49
+ Dynamic: keywords
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+ # 🤖 TradeMind AI — BTC Bot para Polymarket
55
+
56
+ **Versión 2.0** | Análisis de Mercados de Predicción en Tiempo Real
57
+
58
+ ---
59
+
60
+ ## ⚠️ ADVERTENCIA IMPORTANTE
61
+
62
+ **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.
63
+
64
+ > 📄 Lea el [DISCLAIMER completo](DISCLAIMER.md) antes de usar el software.
65
+
66
+ ---
67
+
68
+ ## 🚀 Instalación para Compradores (compraste una key)
69
+
70
+ Tienes **3 opciones** según tu nivel técnico:
71
+
72
+ ### Opción A — Doble click (la más fácil) 👍
73
+ 1. Descarga el instalador: <https://trademind-bot.vercel.app/downloads/install.bat> (Windows) o <https://trademind-bot.vercel.app/downloads/install.sh> (Mac/Linux)
74
+ 2. Si estás en **Mac/Linux**, primero hace: `chmod +x install.sh`
75
+ 3. **Doble click** (o ejecuta en terminal: Windows: `install.bat` / Mac-Linux: `./install.sh`)
76
+ 4. Pega tu key cuando te la pida
77
+ 5. Listo, el navegador se abre con el bot
78
+
79
+ > 💡 **Truco para Mac/Linux sin descargar nada:**
80
+ > ```bash
81
+ > curl -sSL https://trademind-bot.vercel.app/downloads/install.sh | bash
82
+ > ```
83
+ > Eso descarga, le da permisos, y ejecuta en un solo paso.
84
+
85
+ ### Opción B — Una línea en la terminal
86
+ ```bash
87
+ pip install https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
88
+ trademind activate TU-KEY-XXX-XXX-XXX-XX
89
+ trademind
90
+ ```
91
+
92
+ ### Opción C — Si TradeMind AI está publicado en PyPI
93
+ ```bash
94
+ pip install trademind-ai
95
+ trademind activate TU-KEY-XXX-XXX-XXX-XX
96
+ trademind
97
+ ```
98
+
99
+ > 📦 **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.
100
+
101
+ ---
102
+
103
+ ## 🛠 Instalación para Desarrolladores (instalar el código fuente)
104
+
105
+ ### Requisitos
106
+
107
+ - **Python 3.10+**
108
+ - **Windows / Mac / Linux**
109
+ - Conexión a Internet
110
+
111
+ ### Build local
112
+
113
+ ```bash
114
+ # 1. Clonar el repo
115
+ git clone https://github.com/tu-usuario/trademind-ai.git
116
+ cd trademind-ai
117
+
118
+ # 2. Build del paquete (genera dist/trademind_ai-X.Y.Z-py3-none-any.whl)
119
+ python -m build
120
+
121
+ # 3. Instalar tu build local
122
+ pip install -e .
123
+
124
+ # 4. Publicar a PyPI (cuando estés listo)
125
+ python -m twine upload dist/*
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 🎯 ¿Qué hace TradeMind AI?
131
+
132
+ | Funcionalidad | Descripción |
133
+ |---|---|
134
+ | **BTC Bot** | Analiza mercados "Bitcoin Up/Down" de 15 y 5 minutos |
135
+ | **Veredicto** | UP / DOWN / SIN SEÑAL basado en 7 indicadores técnicos |
136
+ | **Gráfica TradingView** | BTC/USD interactiva con timeframes 1m-1W |
137
+ | **Predicciones** | Probabilidad estimada para cada ventana de Polymarket |
138
+ | **Kelly Criterion** | Tamaño de apuesta óptimo basado en bankroll y edge |
139
+ | **Auto-Trading** | El bot puede apostar automáticamente (PAPEL o REAL) |
140
+ | **TP/SL** | Take Profit +25% / Stop Loss -50% automático |
141
+ | **Emergency Stop** | Botón para cerrar todas las posiciones al instante |
142
+
143
+ ---
144
+
145
+ ## 📦 Publicar el paquete (para el dueño)
146
+
147
+ Si sos el dueño y querés publicar `trademind-ai` a PyPI (la opción C para compradores):
148
+
149
+ ```bash
150
+ # Una sola vez: crear cuenta en https://pypi.org/account/register/
151
+ # - Habilitar 2FA
152
+ # - Crear API token en https://pypi.org/manage/account/token/
153
+
154
+ # Cada vez que lanzás nueva versión:
155
+ cd trademind-ai
156
+ # 1. Bump version en trademind/__version__.py
157
+ # 2. Build
158
+ python -m build
159
+ # 3. Publish (te pide username = __token__ y password = tu API token)
160
+ python -m twine upload dist/*
161
+ # 4. Verificar que quedó
162
+ pip install --upgrade trademind-ai
163
+ ```
164
+
165
+ 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.
166
+
167
+ ---
168
+
169
+ ## 🕹️ Modos de Uso
170
+
171
+ ### 🎭 Modo PAPEL (RECOMENDADO)
172
+ - Simula operaciones sin dinero real
173
+ - Ideal para probar el bot y ver resultados históricos
174
+ - Mismo panel de control, sin riesgo
175
+
176
+ ### 💀 Modo REAL (EXPERIMENTAL)
177
+ - **REQUIERE**: Wallet de Polygon con USDC y MATIC
178
+ - **REQUIERE**: Llave privada (¡NUNCA la comparta!)
179
+ - El bot ejecuta órdenes reales en Polymarket CLOB
180
+ - **ALTO RIESGO de pérdida total**
181
+
182
+ ---
183
+
184
+ ## 📊 Panel de Control
185
+
186
+ Al abrir `http://localhost:3000` → BTC Bot, verá:
187
+
188
+ ```
189
+ COLUMNA IZQUIERDA:
190
+ ├── 🎯 Veredicto UP/DOWN con confianza
191
+ ├── 💰 Bankroll y apuesta sugerida (Kelly)
192
+ ├── 📈 Gráfica TradingView interactiva
193
+ ├── 📊 Señal de Trading con Stop Loss / Take Profit
194
+ ├── 📉 Predicciones en Vivo (4-6 ventanas)
195
+ └── 🎯 Mercados monitoreados
196
+
197
+ COLUMNA DERECHA:
198
+ ├── ⚙️ Configuración del Bot
199
+ ├── 🤖 TRADING AUTOMÁTICO ← NUEVO
200
+ │ ├── Selector PAPEL / REAL
201
+ │ ├── Balance, P&L, Posiciones
202
+ │ ├── [▶ Iniciar Auto-Trading]
203
+ │ └── [🛑 STOP]
204
+ └── 🚨 Advertencias
205
+ ```
206
+
207
+ ---
208
+
209
+ ## 🔧 Configuración Manual
210
+
211
+ Para iniciar sin el wizard:
212
+
213
+ ```bash
214
+ python main.py
215
+ # Abre http://localhost:3000
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 📜 Licencia
221
+
222
+ Este software se distribuye "TAL CUAL", sin garantías. Consulte [DISCLAIMER.md](DISCLAIMER.md).
223
+
224
+ ---
225
+
226
+ ## 🤝 Soporte
227
+
228
+ TradeMind AI es un proyecto independiente. Para preguntas o sugerencias, abra un issue en el repositorio.
229
+
230
+ ---
231
+
232
+ ## 🔁 Deploy de los installers (PASO OBLIGATORIO antes de vender)
233
+
234
+ 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:
235
+
236
+ ```bash
237
+ # Opción git (auto-deploy)
238
+ git add frontend/public/downloads/
239
+ git commit -m "Add v2.0.0 installers + wheel for buyers"
240
+ git push origin main
241
+ # Vercel auto-deploys → https://trademind-bot.vercel.app/downloads/install.bat queda vivo
242
+
243
+ # Opción CLI (deploy directo)
244
+ npx vercel --prod --token=tu-token-aqui
245
+ ```
246
+
247
+ Después de eso, los compradores pueden bajar los installers desde tu sitio. Verifica con:
248
+
249
+ ```bash
250
+ curl -I https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
251
+ # Debe responder HTTP/2 200
252
+ ```
253
+
254
+ 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`.
255
+
256
+ ---
257
+
258
+ ## 🚀 Despliegue a producción
259
+
260
+ 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:
261
+
262
+ | Archivo | Propósito |
263
+ |---|---|
264
+ | `frontend/netlify.toml` | Build + SPA fallback + cache headers |
265
+ | `frontend/public/_redirects` | SPA fallback belt+suspenders |
266
+ | `Dockerfile` | Backend image para Render/Railway/Fly |
267
+ | `render.yaml` | One-click deploy backend en Render (incluye disco persistente para SQLite) |
268
+ | `.env.production.example` | Checklist de env vars obligatorios |
269
+
270
+ ### Paso 1: Backend en Render
271
+ 1. Subí el repo a GitHub
272
+ 2. en render.com → New → Blueprint → apuntá a tu repo
273
+ 3. Render detecta `render.yaml` y crea todo: el web service + disco persistente de 1GB en `/app/data`
274
+ 4. En el panel Environment, copiá los valores de `.env.production.example` y rellenálos:
275
+ - `TRADEMIND_ADMIN_HASH` (generá con `python -c "import hashlib,sys;print(hashlib.sha256(sys.argv[1].encode()).hexdigest())" 'tu-clave'`)
276
+ - `TRADEMIND_RESEND_API_KEY` + `TRADEMIND_RESEND_FROM` (ya configurados previamente)
277
+ - `TRADEMIND_ALLOWED_ORIGINS=https://TU-SITIO.netlify.app`
278
+ 5. Esperá el primer deploy (~5 min). Anotá la URL: `https://trademind-backend.onrender.com`
279
+
280
+ ### Paso 2: Frontend en Netlify
281
+ 1. en netlify.com → Add new site → Import from Git
282
+ 2. Build command: `CI=false npm run build` (ya está en netlify.toml)
283
+ 3. Publish directory: `build`
284
+ 4. En Site settings → Environment variables, agregá:
285
+ - `REACT_APP_API_BASE_URL` = `https://trademind-backend.onrender.com`
286
+ 5. Deploy. Tu página queda en `https://TU-SITIO.netlify.app`
287
+
288
+ ### ⚠️ Cosas a saber del free tier
289
+ - **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).
290
+ - **CORS**: si Netlify te da un subdominio distinto al que pusiste en `TRADEMIND_ALLOWED_ORIGINS`, los requests van a fallar. Verificá que coincidan exacto.
291
+
292
+ Para más detalles, consultá `SECURITY.md` (postura securidad) y `.freebuff/run.md` (procedimientos de operación local).
293
+
294
+ ---
295
+
296
+ *Hecho con ❤️ para traders que entienden el riesgo.*
@@ -0,0 +1,243 @@
1
+ # 🤖 TradeMind AI — BTC Bot para Polymarket
2
+
3
+ **Versión 2.0** | Análisis de Mercados de Predicción en Tiempo Real
4
+
5
+ ---
6
+
7
+ ## ⚠️ ADVERTENCIA IMPORTANTE
8
+
9
+ **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.
10
+
11
+ > 📄 Lea el [DISCLAIMER completo](DISCLAIMER.md) antes de usar el software.
12
+
13
+ ---
14
+
15
+ ## 🚀 Instalación para Compradores (compraste una key)
16
+
17
+ Tienes **3 opciones** según tu nivel técnico:
18
+
19
+ ### Opción A — Doble click (la más fácil) 👍
20
+ 1. Descarga el instalador: <https://trademind-bot.vercel.app/downloads/install.bat> (Windows) o <https://trademind-bot.vercel.app/downloads/install.sh> (Mac/Linux)
21
+ 2. Si estás en **Mac/Linux**, primero hace: `chmod +x install.sh`
22
+ 3. **Doble click** (o ejecuta en terminal: Windows: `install.bat` / Mac-Linux: `./install.sh`)
23
+ 4. Pega tu key cuando te la pida
24
+ 5. Listo, el navegador se abre con el bot
25
+
26
+ > 💡 **Truco para Mac/Linux sin descargar nada:**
27
+ > ```bash
28
+ > curl -sSL https://trademind-bot.vercel.app/downloads/install.sh | bash
29
+ > ```
30
+ > Eso descarga, le da permisos, y ejecuta en un solo paso.
31
+
32
+ ### Opción B — Una línea en la terminal
33
+ ```bash
34
+ pip install https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
35
+ trademind activate TU-KEY-XXX-XXX-XXX-XX
36
+ trademind
37
+ ```
38
+
39
+ ### Opción C — Si TradeMind AI está publicado en PyPI
40
+ ```bash
41
+ pip install trademind-ai
42
+ trademind activate TU-KEY-XXX-XXX-XXX-XX
43
+ trademind
44
+ ```
45
+
46
+ > 📦 **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.
47
+
48
+ ---
49
+
50
+ ## 🛠 Instalación para Desarrolladores (instalar el código fuente)
51
+
52
+ ### Requisitos
53
+
54
+ - **Python 3.10+**
55
+ - **Windows / Mac / Linux**
56
+ - Conexión a Internet
57
+
58
+ ### Build local
59
+
60
+ ```bash
61
+ # 1. Clonar el repo
62
+ git clone https://github.com/tu-usuario/trademind-ai.git
63
+ cd trademind-ai
64
+
65
+ # 2. Build del paquete (genera dist/trademind_ai-X.Y.Z-py3-none-any.whl)
66
+ python -m build
67
+
68
+ # 3. Instalar tu build local
69
+ pip install -e .
70
+
71
+ # 4. Publicar a PyPI (cuando estés listo)
72
+ python -m twine upload dist/*
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 🎯 ¿Qué hace TradeMind AI?
78
+
79
+ | Funcionalidad | Descripción |
80
+ |---|---|
81
+ | **BTC Bot** | Analiza mercados "Bitcoin Up/Down" de 15 y 5 minutos |
82
+ | **Veredicto** | UP / DOWN / SIN SEÑAL basado en 7 indicadores técnicos |
83
+ | **Gráfica TradingView** | BTC/USD interactiva con timeframes 1m-1W |
84
+ | **Predicciones** | Probabilidad estimada para cada ventana de Polymarket |
85
+ | **Kelly Criterion** | Tamaño de apuesta óptimo basado en bankroll y edge |
86
+ | **Auto-Trading** | El bot puede apostar automáticamente (PAPEL o REAL) |
87
+ | **TP/SL** | Take Profit +25% / Stop Loss -50% automático |
88
+ | **Emergency Stop** | Botón para cerrar todas las posiciones al instante |
89
+
90
+ ---
91
+
92
+ ## 📦 Publicar el paquete (para el dueño)
93
+
94
+ Si sos el dueño y querés publicar `trademind-ai` a PyPI (la opción C para compradores):
95
+
96
+ ```bash
97
+ # Una sola vez: crear cuenta en https://pypi.org/account/register/
98
+ # - Habilitar 2FA
99
+ # - Crear API token en https://pypi.org/manage/account/token/
100
+
101
+ # Cada vez que lanzás nueva versión:
102
+ cd trademind-ai
103
+ # 1. Bump version en trademind/__version__.py
104
+ # 2. Build
105
+ python -m build
106
+ # 3. Publish (te pide username = __token__ y password = tu API token)
107
+ python -m twine upload dist/*
108
+ # 4. Verificar que quedó
109
+ pip install --upgrade trademind-ai
110
+ ```
111
+
112
+ 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.
113
+
114
+ ---
115
+
116
+ ## 🕹️ Modos de Uso
117
+
118
+ ### 🎭 Modo PAPEL (RECOMENDADO)
119
+ - Simula operaciones sin dinero real
120
+ - Ideal para probar el bot y ver resultados históricos
121
+ - Mismo panel de control, sin riesgo
122
+
123
+ ### 💀 Modo REAL (EXPERIMENTAL)
124
+ - **REQUIERE**: Wallet de Polygon con USDC y MATIC
125
+ - **REQUIERE**: Llave privada (¡NUNCA la comparta!)
126
+ - El bot ejecuta órdenes reales en Polymarket CLOB
127
+ - **ALTO RIESGO de pérdida total**
128
+
129
+ ---
130
+
131
+ ## 📊 Panel de Control
132
+
133
+ Al abrir `http://localhost:3000` → BTC Bot, verá:
134
+
135
+ ```
136
+ COLUMNA IZQUIERDA:
137
+ ├── 🎯 Veredicto UP/DOWN con confianza
138
+ ├── 💰 Bankroll y apuesta sugerida (Kelly)
139
+ ├── 📈 Gráfica TradingView interactiva
140
+ ├── 📊 Señal de Trading con Stop Loss / Take Profit
141
+ ├── 📉 Predicciones en Vivo (4-6 ventanas)
142
+ └── 🎯 Mercados monitoreados
143
+
144
+ COLUMNA DERECHA:
145
+ ├── ⚙️ Configuración del Bot
146
+ ├── 🤖 TRADING AUTOMÁTICO ← NUEVO
147
+ │ ├── Selector PAPEL / REAL
148
+ │ ├── Balance, P&L, Posiciones
149
+ │ ├── [▶ Iniciar Auto-Trading]
150
+ │ └── [🛑 STOP]
151
+ └── 🚨 Advertencias
152
+ ```
153
+
154
+ ---
155
+
156
+ ## 🔧 Configuración Manual
157
+
158
+ Para iniciar sin el wizard:
159
+
160
+ ```bash
161
+ python main.py
162
+ # Abre http://localhost:3000
163
+ ```
164
+
165
+ ---
166
+
167
+ ## 📜 Licencia
168
+
169
+ Este software se distribuye "TAL CUAL", sin garantías. Consulte [DISCLAIMER.md](DISCLAIMER.md).
170
+
171
+ ---
172
+
173
+ ## 🤝 Soporte
174
+
175
+ TradeMind AI es un proyecto independiente. Para preguntas o sugerencias, abra un issue en el repositorio.
176
+
177
+ ---
178
+
179
+ ## 🔁 Deploy de los installers (PASO OBLIGATORIO antes de vender)
180
+
181
+ 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:
182
+
183
+ ```bash
184
+ # Opción git (auto-deploy)
185
+ git add frontend/public/downloads/
186
+ git commit -m "Add v2.0.0 installers + wheel for buyers"
187
+ git push origin main
188
+ # Vercel auto-deploys → https://trademind-bot.vercel.app/downloads/install.bat queda vivo
189
+
190
+ # Opción CLI (deploy directo)
191
+ npx vercel --prod --token=tu-token-aqui
192
+ ```
193
+
194
+ Después de eso, los compradores pueden bajar los installers desde tu sitio. Verifica con:
195
+
196
+ ```bash
197
+ curl -I https://trademind-bot.vercel.app/downloads/trademind_ai-2.0.0-py3-none-any.whl
198
+ # Debe responder HTTP/2 200
199
+ ```
200
+
201
+ 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`.
202
+
203
+ ---
204
+
205
+ ## 🚀 Despliegue a producción
206
+
207
+ 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:
208
+
209
+ | Archivo | Propósito |
210
+ |---|---|
211
+ | `frontend/netlify.toml` | Build + SPA fallback + cache headers |
212
+ | `frontend/public/_redirects` | SPA fallback belt+suspenders |
213
+ | `Dockerfile` | Backend image para Render/Railway/Fly |
214
+ | `render.yaml` | One-click deploy backend en Render (incluye disco persistente para SQLite) |
215
+ | `.env.production.example` | Checklist de env vars obligatorios |
216
+
217
+ ### Paso 1: Backend en Render
218
+ 1. Subí el repo a GitHub
219
+ 2. en render.com → New → Blueprint → apuntá a tu repo
220
+ 3. Render detecta `render.yaml` y crea todo: el web service + disco persistente de 1GB en `/app/data`
221
+ 4. En el panel Environment, copiá los valores de `.env.production.example` y rellenálos:
222
+ - `TRADEMIND_ADMIN_HASH` (generá con `python -c "import hashlib,sys;print(hashlib.sha256(sys.argv[1].encode()).hexdigest())" 'tu-clave'`)
223
+ - `TRADEMIND_RESEND_API_KEY` + `TRADEMIND_RESEND_FROM` (ya configurados previamente)
224
+ - `TRADEMIND_ALLOWED_ORIGINS=https://TU-SITIO.netlify.app`
225
+ 5. Esperá el primer deploy (~5 min). Anotá la URL: `https://trademind-backend.onrender.com`
226
+
227
+ ### Paso 2: Frontend en Netlify
228
+ 1. en netlify.com → Add new site → Import from Git
229
+ 2. Build command: `CI=false npm run build` (ya está en netlify.toml)
230
+ 3. Publish directory: `build`
231
+ 4. En Site settings → Environment variables, agregá:
232
+ - `REACT_APP_API_BASE_URL` = `https://trademind-backend.onrender.com`
233
+ 5. Deploy. Tu página queda en `https://TU-SITIO.netlify.app`
234
+
235
+ ### ⚠️ Cosas a saber del free tier
236
+ - **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).
237
+ - **CORS**: si Netlify te da un subdominio distinto al que pusiste en `TRADEMIND_ALLOWED_ORIGINS`, los requests van a fallar. Verificá que coincidan exacto.
238
+
239
+ Para más detalles, consultá `SECURITY.md` (postura securidad) y `.freebuff/run.md` (procedimientos de operación local).
240
+
241
+ ---
242
+
243
+ *Hecho con ❤️ para traders que entienden el riesgo.*
@@ -0,0 +1 @@
1
+ # TradeMind AI Backend
@@ -0,0 +1 @@
1
+ from .ai_service import AIService