OPEN-SOURCE SCRIPT
Contract Value Tracker[VT]

### Contract Value Tracker - 合约价值追踪器
**指标简介**
Contract Value Tracker 是一款专业的期货合约价值分析工具,专为多品种交易者设计。它实时计算当前K线波动所产生的合约价值,并根据设定的风险金额自动建议交易手数,帮助交易者快速评估风险和仓位规模。
**核心功能**
1. **智能合约匹配**
- 自动识别当前图表品种,只显示匹配的合约信息
- 支持最多20个合约的预配置库,一键切换图表自动更新
- 可选择"全部显示"模式,同时查看所有配置合约
2. **实时价值计算**
- **K线价值**:根据K线形态(阳线/阴线)实时计算当前波动幅度 × 合约点值
- **每$1价值**:预设的合约价格变动1美元的盈亏金额
- **建议手数**:基于用户设定的风险金额 ÷ K线价值,自动计算最优交易手数
3. **多语言支持**
- 支持简体中文、繁體中文、English三种语言
- 表格表头实时切换,满足不同地区用户需求
4. **灵活配置选项**
- 可自定义表格位置(9个位置可选)
- 可调节文字大小(tiny / small / normal / large / huge)
- 可自定义颜色(表头、数据行、边框)
- 可选择显示/隐藏 K线价值列、建议手数列
- 风险金额可自由设定
5. **预设合约库(12个常用品种)**
| 微型合约 | 每$1价值 | 标准合约 | 每$1价值 |
|---------|---------|---------|---------|
| MGC1! | $10.00 | GC1! | $100.00 |
| MNQ1! | $2.00 | NQ1! | $20.00 |
| MES1! | $5.00 | ES1! | $50.00 |
| MYM1! | $5.00 | YM1! | $50.00 |
| M2K1! | $5.00 | RTY1! | $50.00 |
| MCL1! | $100.00 | CL1! | $1000.00 |
**适用场景**
- 日内交易者:快速评估当前K线的盈亏潜力
- 风险管理:根据风险金额自动计算建议手数
- 多品种交易者:一键切换图表,自动更新合约参数
- 资金管理:实时了解每1美元价格变动对账户的影响
**使用方法**
1. 将指标添加到图表
2. 在设置中配置您的常用合约(代码和每$1价值)
3. 设定风险金额(建议手数计算依据)
4. 选择显示模式(自动匹配/全部显示)
5. 根据需要调整表格位置、大小、颜色
### Contract Value Tracker
**Overview**
Contract Value Tracker is a professional futures contract value analysis tool designed for multi-symbol traders. It calculates the contract value generated by current candle fluctuations in real-time and automatically suggests optimal trading lots based on your risk amount, helping traders quickly assess risk and position sizing.
**Key Features**
1. **Smart Contract Matching**
- Automatically detects the current chart symbol and displays only the matching contract information
- Supports up to 20 pre-configured contracts in the library, auto-updates when switching charts
- "Show All" mode available for viewing all configured contracts simultaneously
2. **Real-Time Value Calculation**
- **Candle Value**: Real-time calculation of current price movement × contract point value based on candle type (bullish/bearish)
- **Value per $1**: Pre-set contract value for a $1 price movement
- **Suggested Lots**: Automatically calculates optimal trading lots based on user-defined risk amount ÷ Candle Value
3. **Multi-Language Support**
- Supports Simplified Chinese, Traditional Chinese, and English
- Table headers switch instantly to accommodate users from different regions
4. **Flexible Configuration Options**
- Customizable table position (9 positions available)
- Adjustable text size (tiny / small / normal / large / huge)
- Customizable colors (header, data rows, border)
- Toggle Candle Value and Suggested Lots columns on/off
- Freely adjustable risk amount
5. **Pre-Configured Contract Library (12 Popular Symbols)**
| Micro Contracts | Value per $1 | Standard Contracts | Value per $1 |
|----------------|--------------|--------------------|--------------|
| MGC1! | $10.00 | GC1! | $100.00 |
| MNQ1! | $2.00 | NQ1! | $20.00 |
| MES1! | $5.00 | ES1! | $50.00 |
| MYM1! | $5.00 | YM1! | $50.00 |
| M2K1! | $5.00 | RTY1! | $50.00 |
| MCL1! | $100.00 | CL1! | $1000.00 |
**Use Cases**
- **Day Traders**: Quickly assess profit/loss potential of current candle
- **Risk Management**: Automatically calculate suggested lots based on risk amount
- **Multi-Symbol Traders**: Switch charts with one click, contract parameters update automatically
- **Money Management**: Understand the impact of each $1 price movement on your account
**How to Use**
1. Add the indicator to your chart
2. Configure your commonly traded contracts (symbol and value per $1) in settings
3. Set your risk amount (used for suggested lots calculation)
4. Choose display mode (Auto Match / Show All)
5. Adjust table position, size, and colors as needed
---
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.