π€ Claude API Setup Guide
Complete guide to configure Claude AI validation for Quantum Edge Trader
β±οΈ Estimated Time: 5-10 minutes
Cost: Pay-as-you-go, approximately $0.01-0.05 per trade (~$5-20/month for active trading)
Why Claude AI Validation?
The Claude AI integration provides an additional layer of trade validation:
- β Analyzes market context beyond technical indicators
- β Evaluates chart patterns and support/resistance
- β Considers news sentiment and market conditions
- β Filters out low-probability setups
- β Improves win rate by 5-15% (historical data)
How it works: Before executing a trade, the EA sends trade details to Claude AI for analysis. Claude responds with “APPROVE” or “REJECT” based on market context. Only approved trades are executed.
Step 1: Create Anthropic Account
- Go to console.anthropic.com
- Click Sign Up
- Register with:
- Email address (verify via link sent to inbox)
- Or sign up with Google/GitHub
- Complete account verification
Note: Anthropic account is separate from your Claude.ai chat account (if you have one).
Step 2: Add Payment Method & Credit
- Log in to console.anthropic.com
- Go to Settings > Billing
- Click Add Payment Method
- Enter credit card details (Visa, Mastercard, Amex accepted)
- Add initial credit:
- Testing/Demo: $5 (enough for 100-500 validations)
- Light Trading: $10-15/month
- Active Trading: $20-30/month
π° Pricing Breakdown
| Model | Cost per Request | Recommended For |
|---|---|---|
| Claude 3.5 Sonnet | ~$0.01-0.02 | Production trading (default) |
| Claude 3 Haiku | ~$0.001-0.003 | Budget option (lower accuracy) |
Example monthly cost:
- 50 trades/month Γ $0.015 = $0.75
- 200 trades/month Γ $0.015 = $3.00
- 1000 trades/month Γ $0.015 = $15.00
Step 3: Generate API Key
- In console, go to API Keys section
- Click Create Key
- Enter a descriptive name:
QuantumEdgeTrader-Production - Click Create
- Copy the generated API key (format:
sk-ant-api03-...)
π Security Warning
NEVER share your API key publicly!
- β Don’t post in forums or social media
- β Don’t share in screenshots
- β Don’t commit to public GitHub repos
- β Store securely (password manager recommended)
- β Regenerate if compromised
Step 4: Configure EA with API Key
- Open MetaTrader 5
- Right-click on the chart with Quantum Edge Trader attached
- Select Expert Advisors > Properties
- Go to Inputs tab
- Find parameter
InpClaudeAPIKey - Paste your API key (entire string, no spaces)
- Verify other AI settings:
InpEnableAI: trueInpClaudeModel: claude-3-5-sonnet-20241022InpAIConfidenceThreshold: 70 (0-100 scale)
- Click OK
Step 5: Verify API Connection
Check Experts Journal
- Open Toolbox panel (Ctrl+T)
- Click Experts tab
- Look for confirmation message:
Claude AI initialized API key validated Model: claude-3-5-sonnet-20241022 AI validation: ENABLED
Check Visual Panel
The visual panel should show:
- AI Status: “Connected” (green)
- API Credits: Remaining balance
- AI Approval Rate: % of approved vs rejected signals
Test API Connection (Manual)
You can test the API connection manually:
- Open Anthropic Workbench
- Send a test message: “Hello, Claude!”
- If you get a response, your API is working
- Check Usage tab to see API calls being logged
Step 6: Monitor Usage & Costs
Track API Usage
- Go to console.anthropic.com
- Navigate to Usage & Billing
- View:
- Total API calls this month
- Cost breakdown by model
- Current balance remaining
Set Up Usage Alerts (Recommended)
- Go to Settings > Notifications
- Enable Billing Alerts
- Set thresholds:
- Warning at 75% of monthly budget
- Alert at 90% of monthly budget
- Add your email for notifications
Set Monthly Budget Limit
- Go to Settings > Billing
- Set Monthly Limit (e.g., $50)
- Enable Hard Cap (stops API after limit reached)
Troubleshooting
Error: “Invalid API key”
Solutions:
- Verify key starts with
sk-ant-api03- - Check for extra spaces or characters
- Ensure key wasn’t revoked in console
- Try regenerating a new key
Error: “Insufficient credits”
Solutions:
- Add more credit in console billing section
- Check if monthly limit was reached
- Verify payment method is valid
Error: “Rate limit exceeded”
Solutions:
- Default limit: 50 requests/minute (sufficient for most)
- Reduce EA trade frequency temporarily
- Wait 60 seconds for rate limit reset
- Contact Anthropic for higher limits (if needed)
Error: “WebRequest not allowed”
Solutions:
- Go to MT5: Tools > Options > Expert Advisors
- Enable Allow WebRequest for listed URL
- Add to whitelist:
https://api.anthropic.com - Restart MT5
AI Not Approving Any Trades
Possible causes:
InpAIConfidenceThresholdset too high (try lowering to 60-70)- Market conditions are genuinely poor (AI is being cautious)
- Check Experts Journal for Claude’s rejection reasons
Advanced Configuration
Adjust AI Confidence Threshold
| Threshold | Effect | Recommended For |
|---|---|---|
| 50-60 | More trades, lower quality | Aggressive traders, scalping |
| 65-75 β | Balanced trade frequency and quality | Most traders (default) |
| 80-90 | Fewer trades, higher quality | Conservative, prop firms |
Disable AI (Fallback Option)
If you want to trade without AI validation temporarily:
- Set
InpEnableAIto false - EA will use only technical indicators
- No API costs incurred
- Lower win rate expected (5-15% drop historically)
Switch to Budget Model (Haiku)
For lower costs with slightly reduced accuracy:
- Change
InpClaudeModelto:claude-3-haiku-20240307 - Cost: ~70-80% cheaper than Sonnet
- Accuracy: ~5-10% lower than Sonnet
Best Practices
- β Start with $5-10 credit for testing
- β Monitor usage for first week to estimate monthly cost
- β Set monthly budget limits to prevent surprises
- β Keep API key secure and never share publicly
- β Regenerate key if compromised
- β Use Sonnet model for production (best accuracy)
- β Review Claude’s rejection reasons to understand market conditions
- β Don’t disable AI in volatile markets (highest value)
- β Don’t set confidence threshold too high or too low
FAQ
Is Claude API required?
No, but highly recommended. The EA can operate without AI validation, but you’ll miss out on the intelligent trade filtering that significantly improves performance.
Can I use free tier?
Anthropic doesn’t offer a completely free tier for API usage, but you only pay for what you use (pay-as-you-go). Start with $5 for testing – it typically lasts 1-2 weeks of active trading.
What happens if I run out of credits?
The EA will continue monitoring but won’t execute new trades. You’ll see “Insufficient API credits” in the Experts Journal. Simply add more credit to resume trading.
Can I use one API key for multiple EAs?
Yes! You can use the same API key across multiple MT5 accounts or EA instances. Usage will be pooled under one Anthropic account.
How do I view Claude’s trade analysis?
Check the Experts Journal in MT5. For each potential trade, Claude provides a brief analysis explaining why it approved or rejected the setup.
Need Help with API Setup?
Our support team is here to assist:
- π§ Email: support@quantumedge-trading.com
- π¬ Live Chat: Available during business hours
- π Full documentation: User Manual (PDF)
Response time: 24-48 business hours