From 3aee961b384af57615b3795ace10476b70250d8e Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Fri, 6 Feb 2026 20:16:45 +0800 Subject: [PATCH] feat: Document smart dynamic position strategy, paper trading report format, and VPS update instructions, and refine core features. --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++-- README_EN.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 141 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f75d8d3b..d1e9f73f 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,43 @@ python run.py --- +## 🎯 智能动态仓位策略 + +系统结合 **Open-Meteo 天气预测**、**成交量** 和 **价格锁定程度** 自动决定仓位大小: + +| 条件组合 | 仓位 | 标签 | 说明 | +| ------------------------------- | ------- | ---------- | -------------- | +| 价格 ≥90¢ + 天气支持 + 高成交量 | **$10** | 🔥高置信 | 三重确认,重注 | +| 价格 ≥90¢ + 天气支持 | **$7** | ⭐中置信 | 双重确认 | +| 价格 ≥92¢ | **$5** | 📌价格锁定 | 纯价格锁定 | +| 其他 85-91¢ | **$3** | 💡试探 | 最小仓位试探 | + +### 天气支持判断逻辑 + +- **买 NO**:Open-Meteo 预测温度在选项区间 **之外** (±2° 容差) +- **买 YES**:Open-Meteo 预测温度 **落入** 选项区间 + +### 成交量判断 + +- **高成交量**:单个选项成交量 ≥ $5,000 + +--- + ## 📢 推送维度说明 ### 1. 📂 城市预警汇总 (主动推送) - **优化机制**: 同一轮扫描中,同一城市的所有异动将**合并为一条消息**发送,拒绝刷屏。 -- **触发内容**: 包含该城市下所有符合条件的“价格预警”与“市场异常”。 +- **触发内容**: 包含该城市下所有符合条件的"价格预警"与"市场异常"。 +- **推送格式**: + ``` + ⚡ 40-41°F (2026-02-06): Buy No 87¢ | 预测:38°F [🛒 $10.0 🔥高置信] + ``` ### 2. ⚡ 价格预警 (触发模拟买入) - **触发条件**: Buy Yes 或 Buy No 价格在 **85¢-95¢** 区间。 -- **关联动作**: 系统会自动在该档位执行 **5 USD 的模拟开仓**,用于验证胜率。 +- **关联动作**: 系统根据智能仓位策略自动执行 **$3-$10** 的模拟开仓。 - **用途**: 高胜率/即将锁定区间提醒,适合平仓或收割。 ### 3. 👀 市场异常 @@ -56,6 +82,33 @@ python run.py --- +## 📊 模拟交易报告格式 + +通过 `/portfolio` 指令查看,报告按**目标日期分组**显示: + +``` +📊 模拟交易报告 +════════════════════ + +📈 【2026-02-06】 小计: +2.45$ +────────────────── +🟢 Chicago 40-41°F + NO 87¢→92¢ 预测:38 | +0.47$ +🟢 Chicago 32-33°F + NO 94¢→98¢ 预测:38 | +0.12$ + +💰 持仓总计: +6.89$ + +📈 历史战绩: +累计成交: 18笔 | 胜率: 100.0% +已投入: $90.00 | 盈亏: +12.50$ (+13.9%) + +════════════════════ +💳 账户余额: $639.11 +``` + +--- + ## 🛠️ 环境配置 (.env) ```bash @@ -66,7 +119,7 @@ TELEGRAM_CHAT_ID=your_chat_id # Polymarket API (用于批量获取实时盘口价格与交易历史) POLYMARKET_API_KEY=your_api_key_here -# 代理设置 (如需要) +# 代理设置 (如需要,VPS 部署时可删除) HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ``` @@ -75,6 +128,8 @@ HTTP_PROXY=http://127.0.0.1:7890 ## 📋 核心功能特性 +- ✅ **智能动态仓位**: 结合天气预测、成交量、价格锁定程度自动调整仓位 ($3-$10)。 +- ✅ **预测温度追踪**: 每笔交易记录买入时的 Open-Meteo 预测温度,方便复盘验证。 - ✅ **智能合并推送**: 按城市汇总预警,界面整洁不刷屏。 - ✅ **全自动模拟交易**: 内置模拟仓位系统,支持 85-95¢ 区间自动跟单,记录实战胜率。 - ✅ **极速价格同步**: 采用 Polymarket 批量 API 接口,一次同步全量城市,无延迟、无 404。 @@ -84,3 +139,13 @@ HTTP_PROXY=http://127.0.0.1:7890 - ✅ **全量数据持久化**: 信号记录、推送历史、交易仓位均保存至本地 JSON。 --- + +## 🔄 VPS 更新步骤 + +```bash +# 1. 本地推送代码 +git add . && git commit -m "update" && git push + +# 2. VPS 拉取并重启 +ssh root@VPS_IP "cd ~/PolyWeather && git pull && screen -S polyweather -X quit; screen -dmS polyweather python main.py" +``` diff --git a/README_EN.md b/README_EN.md index 06465207..bc3a01fe 100644 --- a/README_EN.md +++ b/README_EN.md @@ -26,17 +26,42 @@ This command launches: --- +## 🎯 Smart Dynamic Position Strategy + +The system automatically decides the position size based on **Open-Meteo Weather Forecasts**, **Volume**, and **Price Locking Degree**: + +| Condition Combination | Size | Tag | Description | +| ------------------------------------------ | ------- | ----------------- | -------------------------------- | +| Price ≥90¢ + Weather Support + High Volume | **$10** | 🔥High Confidence | Triple confirmation, Heavy stake | +| Price ≥90¢ + Weather Support | **$7** | ⭐Mid Confidence | Double confirmation | +| Price ≥92¢ | **$5** | 📌Price Locked | Pure price locking | +| Other 85-91¢ | **$3** | 💡Probe | Minimum stake for probing | + +### Weather Support Logic + +- **Buy NO**: Open-Meteo predicted temperature is **outside** the option range (with ±2° tolerance). +- **Buy YES**: Open-Meteo predicted temperature **falls within** the option range. + +### Volume Detection + +- **High Volume**: Individual option volume ≥ $5,000. + +--- + ## 📢 Alerting Dimensions ### 1. 📂 City Alert Summaries (Push) - **Optimization**: All anomalies for the same city are merged into a **single report** per scan cycle to prevent spamming. -- **Content**: Includes Price Alerts and Market Anomalies (Whales/Volume). +- **Push Format**: + ``` + ⚡ 40-41°F (2026-02-06): Buy No 87¢ | Prediction:38°F [🛒 $10.0 🔥High Conf] + ``` ### 2. ⚡ Price Alerts (Auto Paper Trade) - **Trigger**: Buy Yes or Buy No price enters the **85¢-95¢** range. -- **Auto Action**: System automatically executes a **$5.00 Paper Trade** to track success rate. +- **Auto Action**: System executes a **$3-$10 Paper Trade** based on the dynamic position strategy. - **Purpose**: High-probability / Near-settlement reminders. ### 3. 👀 Market Anomalies @@ -49,16 +74,41 @@ This command launches: - **Trigger**: Triggered automatically around 23:55 (Beijing Time). - **Content**: Summarizes daily floating PnL, balance changes, and win rate. -### 4. 🎯 Trading Signals (Query) +### 5. 🎯 Trading Signals (Query) - Comparison between weather forecasts and market pricing. - Includes: City, bucket, local time, expected temperature (unit-aware), and deviation score. --- -## 🛠️ Configuration (.env) +## 📊 Paper Trading Report Format -Duplicate `.env.example` to `.env` and fill in your credentials: +Accessible via `/portfolio`. Reports are grouped by **Target Settlement Date**: + +``` +📊 Paper Trading Report +════════════════════ + +📈 【2026-02-06】 Subtotal: +2.45$ +────────────────── +🟢 Chicago 40-41°F + NO 87¢→92¢ Pred:38 | +0.47$ +🟢 Chicago 32-33°F + NO 94¢→98¢ Pred:38 | +0.12$ + +💰 Total Exposure PnL: +6.89$ + +📈 Historical Stats: +Trades: 18 | Win Rate: 100.0% +Total Cost: $90.00 | Total PnL: +12.50$ (+13.9%) + +════════════════════ +💳 Account Balance: $639.11 +``` + +--- + +## 🛠️ Configuration (.env) ```bash # Telegram Bot @@ -68,19 +118,33 @@ TELEGRAM_CHAT_ID=your_chat_id # Polymarket API (Used for real-time prices & trade history) POLYMARKET_API_KEY=your_api_key_here -# Proxy (Optional) +# Proxy (Optional, remove for VPS deployment) HTTPS_PROXY=http://127.0.0.1:7890 +HTTP_PROXY=http://127.0.0.1:7890 ``` --- ## 📋 Core Features +- ✅ **Smart Dynamic Positions**: Automatic adjustment ($3-$10) based on weather forecasts, volume, and locking degree. +- ✅ **Predicted Temp Tracking**: Records the Open-Meteo forecast at the time of purchase for retrospective analysis. - ✅ **Smart Merged Push**: City-based alert aggregation for a clean interface. +- ✅ **Auto Paper Trading**: Built-in system for tracking performance within the 85-95¢ range. - ✅ **High-Speed Price Sync**: Utilizes CLOB batch API for instant price updates without 404s. - ✅ **Timezone Adaptation**: All timestamps are automatically adjusted to Beijing Time (UTC+8). -- ✅ **Smart Date Selection**: Automatically targets the earliest active market date and rolls over after settlement. -- ✅ **Unit Sensitivity**: US markets display Fahrenheit (°F), while others use Celsius (°C). -- ✅ **Data Persistence**: Local JSON storage for signals and push history to ensure no duplicates after restart. +- ✅ **Smart Date Selection**: Automatically targets the earliest active market date. +- ✅ **Unit Sensitivity**: US markets use Fahrenheit (°F), others use Celsius (°C). +- ✅ **Data Persistence**: Local JSON storage ensures consistency after restarts. --- + +## 🔄 VPS Update Instructions + +```bash +# 1. Local update +git add . && git commit -m "update" && git push + +# 2. VPS pull & restart +ssh root@VPS_IP "cd ~/PolyWeather && git pull && screen -S polyweather -X quit; screen -dmS polyweather python main.py" +```