mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 16:26:57 +08:00
Merge branch 'dev' into beta
# Conflicts: # .github/workflows/docker-build.yml # .gitignore # api/server.go # config/config.go # config/database.go # decision/engine.go # docker-compose.yml # go.mod # go.sum # logger/telegram_sender.go # main.go # mcp/client.go # prompts/adaptive.txt # prompts/default.txt # prompts/nof1.txt # start.sh # trader/aster_trader.go # trader/auto_trader.go # trader/binance_futures.go # trader/hyperliquid_trader.go # web/package-lock.json # web/package.json # web/src/App.tsx # web/src/components/AILearning.tsx # web/src/components/AITradersPage.tsx # web/src/components/CompetitionPage.tsx # web/src/components/EquityChart.tsx # web/src/components/Header.tsx # web/src/components/LoginPage.tsx # web/src/components/RegisterPage.tsx # web/src/components/TraderConfigModal.tsx # web/src/components/TraderConfigViewModal.tsx # web/src/components/landing/FooterSection.tsx # web/src/components/landing/HeaderBar.tsx # web/src/contexts/AuthContext.tsx # web/src/i18n/translations.ts # web/src/lib/api.ts # web/src/lib/config.ts # web/src/types.ts
This commit is contained in:
@@ -111,15 +111,15 @@
|
||||
**重要**:`position_size_usd` 是**名义价值**(包含杠杆),非保证金需求。
|
||||
|
||||
**计算步骤**:
|
||||
1. **可用保证金** = Available Cash × 0.95 × 配置比例(预留5%手续费)
|
||||
1. **可用保证金** = Available Cash × 0.88(预留12%给手续费、滑点与清算保证金缓冲)
|
||||
2. **名义价值** = 可用保证金 × Leverage
|
||||
3. **position_size_usd** = 名义价值(JSON中填写此值)
|
||||
4. **实际币数** = position_size_usd / Current Price
|
||||
|
||||
**示例**:可用资金 $500,杠杆 5x,配置 100%
|
||||
- 可用保证金 = $500 × 0.95 = $475
|
||||
- position_size_usd = $475 × 5 = **$2,375** ← JSON填此值
|
||||
- 实际占用保证金 = $475,剩余 $25 用于手续费
|
||||
**示例**:可用资金 $500,杠杆 5x
|
||||
- 可用保证金 = $500 × 0.88 = $440
|
||||
- position_size_usd = $440 × 5 = **$2,200** ← JSON填此值
|
||||
- 实际占用保证金 = $440,剩余 $60 用于手续费、滑点与清算保护
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -55,15 +55,15 @@ You have exactly SIX possible actions per decision cycle:
|
||||
|
||||
## Calculation Steps:
|
||||
|
||||
1. **Available Margin** = Available Cash × 0.95 × Allocation % (reserve 5% for fees)
|
||||
1. **Available Margin** = Available Cash × 0.88 (reserve 12% for fees, slippage & liquidation margin buffer)
|
||||
2. **Notional Value** = Available Margin × Leverage
|
||||
3. **position_size_usd** = Notional Value (this is the value for JSON)
|
||||
4. **Position Size (Coins)** = position_size_usd / Current Price
|
||||
|
||||
**Example**: Available Cash = $500, Leverage = 5x, Allocation = 100%
|
||||
- Available Margin = $500 × 0.95 × 100% = $475
|
||||
- position_size_usd = $475 × 5 = **$2,375** ← Fill this value in JSON
|
||||
- Actual margin used = $475, remaining $25 for fees
|
||||
**Example**: Available Cash = $500, Leverage = 5x
|
||||
- Available Margin = $500 × 0.88 = $440
|
||||
- position_size_usd = $440 × 5 = **$2,200** ← Fill this value in JSON
|
||||
- Actual margin used = $440, remaining $60 for fees, slippage & liquidation protection
|
||||
|
||||
## Sizing Considerations
|
||||
|
||||
@@ -94,14 +94,15 @@ For EVERY trade decision, you MUST specify:
|
||||
- Examples: "BTC breaks below $100k", "RSI drops below 30", "Funding rate flips negative"
|
||||
- Must be objective and observable
|
||||
|
||||
4. **confidence** (float, 0-1): Your conviction level in this trade
|
||||
- 0.0-0.3: Low confidence (avoid trading or use minimal size)
|
||||
- 0.3-0.6: Moderate confidence (standard position sizing)
|
||||
- 0.6-0.8: High confidence (larger position sizing acceptable)
|
||||
- 0.8-1.0: Very high confidence (use cautiously, beware overconfidence)
|
||||
4. **confidence** (int, 0-100): Your conviction level in this trade
|
||||
- 0-30: Low confidence (avoid trading or use minimal size)
|
||||
- 30-60: Moderate confidence (standard position sizing)
|
||||
- 60-80: High confidence (larger position sizing acceptable)
|
||||
- 80-100: Very high confidence (use cautiously, beware overconfidence)
|
||||
|
||||
5. **risk_usd** (float): Dollar amount at risk (distance from entry to stop loss)
|
||||
- Calculate as: |Entry Price - Stop Loss| × Position Size × Leverage
|
||||
- Calculate as: |Entry Price - Stop Loss| × Position Size (in coins)
|
||||
- ⚠️ **Do NOT multiply by leverage**: Position Size already includes leverage effect
|
||||
|
||||
|
||||
# PERFORMANCE METRICS & FEEDBACK
|
||||
|
||||
Reference in New Issue
Block a user