docs/prompt-guide.md
Version: v1.0 Last Updated: 2025-01-09 Compatible System Version: NoFx v0.x+
Beginners: Quick Start β Official Templates β Quality Checklist Intermediate Users: Core Concepts β Field Reference β System Constraints β Common Errors Advanced Users: Advanced Topics β Mode 3 β Debugging Guide
A Prompt is the "work instruction" you give to the AI trader, determining how the AI analyzes the market and makes trading decisions.
Steps:
prompts/default.txtSuitable for: Beginners who want to start quickly Time required: 2 minutes
Steps:
prompts/default.txt unchangedoverride_base_prompt = false)Effect Explanation:
Final Prompt = Official Base Strategy (Risk Control + Format) + Your Custom Strategy
β β
System guarantees safety Your trading ideas
Suitable for: Intermediate users who want to keep risk controls but add their own ideas Time required: 10-30 minutes
Steps:
override_base_prompt = true)Effect Explanation:
Final Prompt = Your Custom Strategy (Complete Replacement)
β
You need to ensure safety and correct format yourself
Important Warnings:
Suitable for: Advanced users who fully understand the system mechanism Time required: 1-2 hours
π Recommended for Beginners: Jump to Official Template Library and choose a template π Intermediate Optimization: Continue reading Available Fields Reference π Advanced Customization: Read Complete Customization Guide
NoFx builds a message containing market data every 3 minutes to send to the AI:
graph LR
A[Your Prompt
Strategy Instructions] --> B[AI Model]
C[Market Data
Auto-generated] --> B
B --> D[Chain of Thought Analysis]
B --> E[Trading Decision JSON]
Workflow:
Defines the AI's trading philosophy, risk preference, and decision criteria
Example:
You are a conservative trader who only opens positions in high-certainty opportunities.
Entry conditions: Confidence β₯ 85, multiple indicator convergence.
β οΈ Methods 1 & 2: These constraints are automatically added and cannot be overridden β οΈ Method 3: You must include these constraints in your Prompt
Requires AI to output decisions using XML tags and JSON format
Example Output:
<reasoning>
BTC broke support, MACD death cross, volume increased...
</reasoning>
<decision>
```json
[
{
"symbol": "BTCUSDT",
"action": "open_short",
"leverage": 10,
"position_size_usd": 5000,
"stop_loss": 97000,
"take_profit": 91000,
"confidence": 85
}
]
You don't need to request data in the Prompt; the system automatically transmits:
β System Automatically Provides:
β You Don't Need to Write:
Please analyze BTC price and MACD... # System already provides
Please tell me current positions... # System already provides
β You Should Write:
Focus on BTC trend as market indicator
When MACD death cross and volume increases, consider shorting opportunities
The system automatically passes the following data to the AI, which you can reference in your Prompt:
| Field Name | Description | Example |
|---|---|---|
| Time | UTC time | 2025-01-15 10:30:00 UTC |
| Cycle | System run cycle count | #142 (142nd decision) |
| Runtime | System run minutes | 426 minutes |
Actual Output Example:
Time: 2025-01-15 10:30:00 UTC | Cycle: #142 | Runtime: 426 minutes
| Field Name | Description | Unit | Example |
|---|---|---|---|
| Equity | Total account assets | USDT | 1250.50 |
| Balance | Available balance | USDT | 850.30 |
| Balance % | Available/Equity | % | 68.0% |
| P&L | Total P&L percentage | % | +15.2% |
| Margin | Margin usage rate | % | 32.0% |
| Positions | Current position count | count | 2 |
Actual Output Example:
Account: Equity 1250.50 | Balance 850.30 (68.0%) | P&L +15.2% | Margin 32.0% | Positions 2
Prompt Reference Example:
Stop opening new positions when Balance % below 20%
Consider reducing positions when Margin usage exceeds 80%
| Field Name | Description | Unit | Calculation | Example |
|---|---|---|---|---|
| Symbol | Trading pair | - | - | BTCUSDT |
| Side | Long/Short | - | - | LONG |
| Entry | Opening price | USDT | - | 95000.00 |
| Current | Mark price | USDT | - | 96500.00 |
| P&L % | Unrealized P&L % | % | w/ leverage | +2.38% |
| P&L Amount | Unrealized P&L | USDT | Actual USD | +59.50 |
| Peak % | Historical peak P&L% | % | w/ leverage | +5.00% |
| Leverage | Leverage multiple | x | - | 5 |
| Margin | Used margin | USDT | - | 500.00 |
| Liquidation | Liquidation price | USDT | - | 88000.00 |
| Duration | Holding time | min/hour | Calculated | 2h 35min |
β οΈ Important Distinctions:
Actual Output Example:
1. BTCUSDT LONG | Entry 95000.0000 Current 96500.0000 | P&L +2.38% | P&L Amount +59.50 USDT | Peak % 5.00% | Leverage 5x | Margin 500 | Liquidation 88000.0000 | Duration 2h 35min
Prompt Reference Examples (β Correct):
β
When P&L Amount drawdown exceeds 50% of Peak %, take partial profit
β
If P&L drops from +5% to +2%, that's 60% drawdown, consider reducing position
β
If Duration exceeds 4 hours but P&L Amount still negative, consider stop loss
Prompt Reference Examples (β Wrong):
β When unrealized_pnl exceeds peak_pnl_pct... # Wrong field names
β When P&L exceeds 5%... # Ambiguous - P&L % or P&L Amount?
Based on the above fields, you can use these calculations in your Prompt:
| Calculation | Formula | Description | Example |
|---|---|---|---|
| True ROI | (P&L Amount / Margin) Γ 100% | Actual return on margin | (59.50/500)Γ100% = 11.9% |
| Drawdown | (Peak % - Current P&L) / Peak % Γ 100% | Drawdown from peak | (5%-2.38%)/5% = 52.4% |
| Liquidation Distance | ` | (Current - Liquidation) / Current | Γ 100%` |
Prompt Reference Example:
Calculate True ROI = P&L Amount / Margin
If True ROI exceeds 10%, take partial profit to lock in gains
Calculate Drawdown = (Peak % - Current P&L) / Peak %
If Drawdown exceeds 50%, significant profit giveback, consider reducing position
| Field Name | Description | Unit | Example |
|---|---|---|---|
| BTC Price | Current price | USDT | 96500.00 |
| 1h Change | 1-hour change | % | +1.25% |
| 4h Change | 4-hour change | % | -2.15% |
| MACD | MACD indicator | - | 0.0024 |
| RSI | RSI(7) indicator | - | 62.50 |
Actual Output Example:
BTC: 96500.00 (1h: +1.25%, 4h: -2.15%) | MACD: 0.0024 | RSI: 62.50
Prompt Reference Example:
BTC as market indicator:
- If BTC 4h Change < -5%, market turning bearish, be cautious on altcoin longs
- If BTC MACD death cross and RSI < 30, potential oversold bounce
Each coin includes complete technical data:
β οΈ Note: These are sequence data (arrays), automatically formatted by system, you don't need to specify field names.
Prompt Reference Example:
Analyze price sequences to identify support/resistance levels
Observe EMA20 trend to determine long/short direction
MACD sequence golden/death cross as signal confirmation
OI rapid growth + price increase = bullish signal
| Field Name | Description | Range | Interpretation |
|---|---|---|---|
| Sharpe Ratio | Risk-adjusted returns | -β ~ +β | >1 excellent, 0~1 normal, <0 losing |
Actual Output Example:
## π Sharpe Ratio: 0.85
Prompt Reference Example:
Adjust strategy based on Sharpe Ratio:
- Sharpe < -0.5: Stop trading, observe for at least 18 minutes
- Sharpe -0.5~0: Only trade confidence >80
- Sharpe 0~0.7: Maintain current strategy
- Sharpe > 0.7: Can moderately increase position size
β Correct Approach: Use natural language labels from output
P&L Amount, Peak %, Margin, Leverage, Duration
β Wrong Approach: Use code field names
unrealized_pnl, peak_pnl_pct, margin_used, leverage
π‘ Core Principle: Field names in Prompt must exactly match natural language labels in system output.
The following constraints are enforced by the system. Methods 1 & 2 automatically add them; Method 3 requires you to include them:
Requirement: Must be β₯ 1:3 (risk 1% for 3%+ reward)
Meaning: Take-profit space must be at least 3x stop-loss space
Examples:
β
Entry 100, Stop 98(-2%), TP 106(+6%) β Risk-reward 6/2 = 3:1 β
β Entry 100, Stop 95(-5%), TP 110(+10%) β Risk-reward 10/5 = 2:1 β
Requirement: Maximum 3 simultaneous positions
Meaning: Diversify risk, avoid overexposure
Requirement:
Example (Account equity 1000 USDT):
β
Altcoin position: 800~1500 USDT
β
BTC/ETH position: 5000~10000 USDT
Requirement:
β οΈ Strictly Enforced: Decisions exceeding limits will be rejected
Requirement: Total margin usage β€ 90%
Meaning: Reserve 10% for liquidation protection and fees
Requirement:
Reason: Exchange minimum notional value + safety margin
The following XML tags are system-reserved and cannot be used in custom Prompts:
β Prohibited:
<reasoning> - For marking chain of thought analysis<decision> - For marking JSON decisionsAI must output decisions in the following format:
<reasoning>
Your analysis...
</reasoning>
<decision>
```json
[
{
"symbol": "BTCUSDT",
"action": "open_short",
"leverage": 10,
"position_size_usd": 5000,
"stop_loss": 97000,
"take_profit": 91000,
"confidence": 85,
"risk_usd": 300
}
]
β Prohibited Items:
1. Range symbols ~
// Wrong
{"position_size_usd": "2000~3000"} // Must be exact value
{"stop_loss": "95000~96000"} // Must be single price
// Correct
{"position_size_usd": 2500}
{"stop_loss": 95500}
2. Thousands separators ,
// Wrong
{"position_size_usd": 98,000} // JSON numbers don't allow commas
// Correct
{"position_size_usd": 98000}
3. Chinese descriptions or comments
// Wrong
{
"symbol": "BTCUSDT",
"action": "open_long", // Open long
"confidence": 80 // Only necessary fields
}
// Correct
{
"symbol": "BTCUSDT",
"action": "open_long",
"confidence": 85
}
| Mode | Configuration | Final Prompt | Use Case |
|---|---|---|---|
| **Mode 1 | |||
| Base Only** | override_base_prompt=false | ||
custom_prompt="" | Official template + Hard constraints + Output format | Beginners | |
| **Mode 2 | |||
| Base+Custom** | override_base_prompt=false | ||
custom_prompt="your strategy" | Official template + Hard constraints + Output format |
override_base_prompt=true
custom_prompt="complete prompt" | Only custom content
(ignores all system defaults) | Advanced |β οΈ Mode 3 Risk Warning:
You are a professional cryptocurrency trading AI with a conservative and steady trading strategy.
# Core Objective
Maximize Sharpe Ratio, emphasizing risk control and stable returns.
Sharpe Ratio = Average Returns / Returns Volatility
This means:
- Only high-certainty trades (confidence β₯ 85)
- Strict stop-loss/take-profit, control drawdown
- Patient holding, avoid frequent trading
- Quality over quantity
# Trading Philosophy
Capital preservation first: Better to miss than make mistakes
Discipline over emotion: Execute plan, don't change arbitrarily
Quality over quantity: Few high-conviction trades beat many low-conviction ones
Respect trends: Don't fight strong trends
# Entry Criteria (Extremely Strict)
Only enter on strong signals; observe when uncertain.
Entry conditions (must all be met):
- Confidence β₯ 85 (high certainty)
- Multiple indicator convergence (at least 3 indicators support)
- Risk-reward ratio β₯ 1:4 (take-profit space 4x+ stop-loss)
- Clear BTC trend (as market indicator)
- Positions < 2 (quality > quantity)
Avoid low-quality signals:
- Single dimension (only one indicator)
- Contradictory (price up but volume shrinking)
- Range-bound choppy
- Just closed position (<30 minutes ago)
# Position Management (Conservative)
Single position: 0.5x account equity (smaller than system default)
Maximum positions: 2 coins (1 less than system default)
Leverage usage:
- Altcoins: 3x leverage (lower than system limit)
- BTC/ETH: 10x leverage (lower than system limit)
# Stop-Loss/Take-Profit (Strict)
Stop-loss: Set immediately after entry, never move stop-loss
Take-profit: Tiered profit-taking
- 50% target reached: Close 30%
- 75% target reached: Close 30%
- 100% target reached: Close all
Drawdown management:
If P&L Amount drawdown from Peak % exceeds 40%, immediately reduce 50% position
# Sharpe Ratio Self-Evolution
Sharpe < -0.5: Stop trading, observe continuously for at least 30 minutes
Sharpe -0.5~0: Only trade confidence β₯ 90
Sharpe 0~1: Maintain current strategy
Sharpe > 1: Can moderately increase to 0.8x equity position
# Decision Process
1. Analyze Sharpe Ratio: Is current strategy effective?
2. Evaluate positions: Should take profit/stop loss?
3. Find new opportunities: Any strong signals?
4. Output decision: Chain of thought + JSON
Remember:
- Goal is Sharpe Ratio, not trading frequency
- Better miss than make low-quality trades
- Every trade must withstand repeated scrutiny
Method 1: Replace Default Template
# Backup original
cp prompts/default.txt prompts/default.txt.bak
# Save above template to prompts/default.txt
# Restart system
docker-compose restart
Method 2: Web Interface Custom
override_base_prompt = falseYou are a professional cryptocurrency trading AI conducting autonomous trading in futures markets.
# Core Objective
Maximize Sharpe Ratio
Sharpe Ratio = Average Returns / Returns Volatility
This means:
- High-quality trades (high win rate, large P&L ratio) β Improve Sharpe
- Stable returns, controlled drawdown β Improve Sharpe
- Patient holding, let profits run β Improve Sharpe
- Frequent trading, small wins/losses β Increase volatility, severely reduce Sharpe
- Overtrading, fee erosion β Direct losses
- Early exits, frequent in/out β Miss major moves
Key insight: System scans every 3 minutes, but doesn't mean trade every time!
Most times should be `wait` or `hold`, only enter on excellent opportunities.
# Trading Philosophy & Best Practices
## Core Principles:
Capital preservation first: Protecting capital more important than pursuing returns
Discipline over emotion: Execute exit plan, don't arbitrarily move stops or targets
Quality over quantity: Few high-conviction trades beat many low-conviction ones
Adapt to volatility: Adjust position size based on market conditions
Respect trends: Don't fight strong trends
## Common Pitfalls to Avoid:
Overtrading: Frequent trading causes fees to erode profits
Revenge trading: Immediately doubling down after loss to "get even"
Analysis paralysis: Over-waiting for perfect signal, missing opportunities
Ignoring correlation: BTC often leads altcoins, must observe BTC first
Over-leverage: Amplifies returns but also amplifies losses
# Trading Frequency Awareness
Quantitative standards:
- Excellent trader: 2-4 trades/day = 0.1-0.2 trades/hour
- Overtrading: >2 trades/hour = serious problem
- Best rhythm: Hold at least 30-60 minutes after opening
Self-check:
If you find yourself trading every cycle β Standards too low
If you find yourself closing positions <30 minutes β Too impatient
# Entry Criteria (Strict)
Only enter on strong signals; observe when uncertain.
Complete data available:
- Raw sequences: 3-min price sequence (MidPrices array) + 4-hour candle sequence
- Technical sequences: EMA20 sequence, MACD sequence, RSI7 sequence, RSI14 sequence
- Capital sequences: Volume sequence, Open Interest (OI) sequence, funding rate
- Filter markers: AI500 score / OI_Top ranking (if marked)
Analysis methods (fully autonomous):
- Freely use sequence data, you can but not limited to trend analysis, pattern recognition, support/resistance, Fibonacci, volatility bands
- Multi-dimensional cross-validation (price + volume + OI + indicators + sequence patterns)
- Use methods you deem most effective to discover high-certainty opportunities
- Combined confidence β₯ 75 to enter
Avoid low-quality signals:
- Single dimension (only one indicator)
- Contradictory (price up but volume shrinking)
- Range-bound choppy
- Just closed position (<15 minutes ago)
# Sharpe Ratio Self-Evolution
Each cycle you receive Sharpe Ratio as performance feedback:
Sharpe < -0.5 (continuous losses):
β Stop trading, observe continuously for at least 6 cycles (18 minutes)
β Deep reflection:
β’ Trading frequency too high? (>2/hour is excessive)
β’ Holding time too short? (<30 minutes is early exit)
β’ Signal strength insufficient? (confidence <75)
Sharpe -0.5 ~ 0 (slight losses):
β Strict control: Only trade confidence >80
β Reduce frequency: Max 1 new position/hour
β Patient holding: Hold at least 30+ minutes
Sharpe 0 ~ 0.7 (positive returns):
β Maintain current strategy
Sharpe > 0.7 (excellent performance):
β Can moderately increase position size
Key: Sharpe Ratio is the only metric, naturally punishes frequent trading and excessive entries/exits.
# Decision Process
1. Analyze Sharpe Ratio: Is current strategy effective? Need adjustments?
2. Evaluate positions: Has trend changed? Should take profit/stop loss?
3. Find new opportunities: Any strong signals? Long/short opportunities?
4. Output decision: Chain of thought + JSON
# Position Size Calculation
**Important**: `position_size_usd` is **notional value** (includes leverage), not margin requirement.
**Calculation Steps**:
1. **Available Margin** = Available Cash Γ 0.88 (reserve 12% for fees, slippage, liquidation buffer)
2. **Notional Value** = Available Margin Γ Leverage
3. **position_size_usd** = Notional Value (fill this in JSON)
4. **Actual Coin Amount** = position_size_usd / Current Price
**Example**: Available cash $500, leverage 5x
- Available Margin = $500 Γ 0.88 = $440
- position_size_usd = $440 Γ 5 = **$2,200** β Fill this in JSON
- Actually occupies margin = $440, remaining $60 for fees, slippage, liquidation protection
---
Remember:
- Goal is Sharpe Ratio, not trading frequency
- Better miss than make low-quality trades
- Risk-reward ratio 1:3 is baseline
Same as Conservative strategy usage.
β οΈ Risk Warning: This strategy has high volatility and may experience significant drawdowns; suitable only for users with strong risk tolerance.
You are a professional cryptocurrency trading AI with an aggressive and proactive trading strategy.
β οΈ Risk Disclosure: This strategy pursues high returns but has high volatility and may experience significant drawdowns.
# Core Objective
Maximize returns while controlling risks and actively seizing market opportunities.
# Trading Philosophy
Opportunity first: Actively seek trading opportunities, don't over-observe
Quick in/out: Capture short-term volatility, timely stop-loss/take-profit
Trend following: Follow market trends, react quickly
Moderate aggression: Maximize position size and leverage within risk control
# Entry Criteria (Relatively Loose)
Entry conditions:
- Confidence β₯ 70 (medium certainty acceptable)
- At least 2 indicators support
- Risk-reward ratio β₯ 1:3 (system minimum)
- Follow major market trend
Scenarios to try:
- Break key resistance/support levels
- Rapid surge/decline initiation
- Abnormal volume surge
- Short-term overbought/oversold reversal
# Position Management (Aggressive)
Single position:
- Altcoins: 1.2~1.5x account equity (near limit)
- BTC/ETH: 8~10x account equity (near limit)
Maximum positions: 3 coins
Leverage usage:
- Altcoins: 4~5x leverage (near limit)
- BTC/ETH: 15~20x leverage (near limit)
# Stop-Loss/Take-Profit (Flexible)
Quick stop-loss: Stop at -3% loss immediately
Tiered take-profit:
- Reach +3%: Close 30%
- Reach +6%: Close 40%
- Reach +9%: Close all
Drawdown management:
P&L Amount drawdown from Peak % exceeds 60%, close all
# Sharpe Ratio Adjustment
Sharpe < -0.5: Pause trading 15 minutes
Sharpe -0.5~0: Reduce position to 0.8x equity
Sharpe 0~0.7: Maintain current strategy
Sharpe > 0.7: Stay aggressive, can full position
# Special Strategies
BTC strong trend following:
- BTC 4h Change > +5%: Prioritize long strong altcoins
- BTC 4h Change < -5%: Quick short or cash out observe
Short-term volatility capture:
- Price volatility >3% in short time (15min), consider reverse trade
- Duration typically 30-60 minutes
Remember:
- Aggressive β gambling, still need strict risk control
- Quick in/out, don't linger
- Control single loss, protect principal
Same as Conservative strategy usage.
β οΈ Reminder: Aggressive strategy suitable for experienced users with strong risk tolerance; beginners use with caution.
Check the following before using custom Prompt:
Clear Strategy Goal
Consistent Entry/Exit Logic
Balanced Risk Control and Profit Goals
No "Want Everything" Contradictions
Field Names Match System Output
unrealized_pnl, peak_pnl_pct, margin_usedFormulas Use Correct Fields
No References to Non-existent Fields
Correct Unit Understanding
Not Trying to Override Hard Constraints (unless Mode 3 and fully understand)
Not Using Reserved Keywords
<reasoning>Entry analysis...</reasoning> in PromptNot Requiring AI to Add Descriptions in JSON
Correctly Understand Three Modes
Clear and Reasonable Risk-Reward Ratio
Clear Stop-Loss/Take-Profit Strategy
Avoid Overtrading
Strategy Testable and Verifiable
Consider Market Condition Changes
β Wrong Example:
When unrealized_pnl exceeds 50% of peak_pnl_pct, take partial profit
Error Reason:
unrealized_pnl and peak_pnl_pctβ Correct Rewrite:
When P&L Amount drawdown exceeds 50% of Peak %, take partial profit
Key Takeaway:
β Wrong Example:
Take profit when P&L exceeds 5%
Error Reason:
β Correct Rewrite:
Option 1: When P&L % exceeds +5%, take partial profit
Option 2: When True ROI (P&L Amount/Margin) exceeds 10%, take partial profit
Key Takeaway:
β Wrong Example:
True ROI = P&L % / Leverage
Error Reason:
β Correct Rewrite:
True ROI = P&L Amount / Margin Γ 100%
Key Takeaway:
β Wrong Example:
Add detailed Chinese explanation in JSON to help me understand decision reasons
Error Reason:
β Correct Rewrite:
reasoning field keep brief (10-20 chars), use keywords to summarize decision rationale
Key Takeaway:
β Wrong Example:
Use <reasoning> tags in your analysis to organize thoughts
Error Reason:
<reasoning> is system-reserved XML tagβ Correct Rewrite:
When analyzing market, first evaluate trend, then confirm indicators, finally make decision
Key Takeaway:
β Wrong Example:
Risk-reward ratio can be appropriately lowered, 2:1 is also acceptable
Error Reason:
β Correct Rewrite:
Strictly follow risk-reward ratio β₯ 1:3, pursue higher 1:4 or 1:5
Key Takeaway:
β Wrong Example:
Use conservative strategy but frequently trade to capture every move
Error Reason:
β Correct Rewrite:
Use conservative strategy, only enter on high-certainty opportunities, mostly observe
Key Takeaway:
β Wrong Example:
Seek trading opportunities every cycle, can't waste any market move
Error Reason:
β Correct Rewrite:
Only enter on strong signals, most cycles should wait or hold
Control trading frequency at 0.1-0.2 trades/hour (2-4 trades/day)
Key Takeaway:
β Wrong Example:
(Prompt completely doesn't mention Sharpe Ratio)
Error Reason:
β Correct Rewrite:
Adjust strategy based on Sharpe Ratio:
- Sharpe < -0.5: Stop trading, observe at least 18 minutes
- Sharpe -0.5~0: Only trade confidence >80
- Sharpe 0~0.7: Maintain current strategy
- Sharpe > 0.7: Can moderately increase position
Key Takeaway:
β Wrong Example:
Set override_base_prompt = true
But custom Prompt doesn't include hard constraints and output format
Error Reason:
β Correct Rewrite:
If using Mode 3, must include in custom Prompt:
1. All hard constraints (risk-reward ratio, position count, leverage, etc.)
2. Complete output format requirements (XML tags + JSON format)
Key Takeaway:
Step 1: View Actual Output
# View system logs, find actual Prompt sent to AI
docker logs nofx-trader | grep "User Prompt"
Step 2: Confirm Field Exists Check if fields you want to reference exist in actual output:
β
Exists: "P&L Amount +59.50 USDT" β Can reference "P&L Amount"
β Doesn't exist: Don't see "KDJ" β Cannot reference KDJ indicator
Step 3: Match Natural Language Labels
Output: "P&L +2.38% | P&L Amount +59.50 USDT | Peak % 5.00%"
β
Correct reference: "P&L %", "P&L Amount", "Peak %"
β Wrong reference: "pnl_pct", "unrealized_pnl", "peak_pnl"
β Do:
P&L Amount, Peak %, Margin, Leverage, Duration
β Don't:
unrealized_pnl, peak_pnl_pct, margin_used, leverage, holding_duration
Code Output (engine.go:387-390):
P&L +2.38% | P&L Amount +59.50 USDT | Peak % 5.00%
Prompt Reference:
β
Correct: "If P&L Amount drawdown exceeds 50% of Peak %..."
β Wrong: "If unrealized_pnl drawdown exceeds 50% of peak_pnl_pct..."
Low Impact (Safe):
Medium Impact (Cautious):
High Impact (Dangerous):
1. Incremental Addition Over Modification
2. Backward Compatibility
3. Provide Migration Guide
β οΈ Warning: This mode only suitable for advanced users who fully understand system mechanics
Your custom Prompt must include:
[Your Core Strategy]
# Hard Constraints
1. Risk-reward ratio β₯ 1:3
2. Maximum 3 positions
3. Single position: Altcoin 0.8-1.5x equity, BTC/ETH 5-10x equity
4. Leverage: Altcoin β€5x, BTC/ETH β€20x
5. Margin usage β€ 90%
6. Minimum opening: General β₯12U, BTC/ETH β₯60U
# Output Format
Use <reasoning> and <decision> tags:
<reasoning>
Chain of thought analysis
</reasoning>
<decision>
```json
[{decision object}]
Symptom: System error "JSON parsing failed"
Investigation Steps:
docker logs nofx-trader | tail -100
<reasoning> and <decision> usedCommon Causes:
<decision> tagSolution:
Symptom: System error "Decision validation failed"
Investigation Steps:
docker logs nofx-trader | grep "Validation failed"
Common Causes:
Solution:
Before outputting decision, self-check:
- Is risk-reward ratio β₯ 1:3?
- Is leverage within limits?
- Does position size meet requirements?
Symptom: AI's decisions don't match your expectations
Investigation Steps:
docker logs nofx-trader | grep -A 20 "<reasoning>"
Optimization Suggestions:
Use More Specific Quantitative Indicators
β Vague: "When market has long opportunity"
β
Specific: "When MACD golden cross and RSI < 70 and volume surge > 20%"
Avoid Vague Expressions
β Avoid: "feel", "might", "probably"
β
Use: "when...", "if...then...", "must..."
Add Specific Numerical Thresholds
β Vague: "Price significant rise"
β
Specific: "Price rises >3% within 15 minutes"
Check Logic Consistency
Entry and exit conditions should correspond
If entry based on MACD golden cross, exit can use MACD death cross
When encountering issues, please provide the following information:
Problem Description: [Briefly describe the issue]
Usage Method: [Method 1/2/3]
Prompt Content:
[Paste your Prompt content]
Error Logs:
[Paste relevant error logs]
Expected Behavior: [What you expected]
Actual Behavior: [What actually happened]
Document Version: v1.0 Last Updated: 2025-01-09 Maintainer: Nofx Team CoderMageFox