**Documentation Structure:** - Created docs/ subdirectory organization (analysis/, architecture/, bugs/, cluster/, deployments/, roadmaps/, setup/, archived/) - Moved 68 root markdown files to appropriate categories - Root directory now clean (only README.md remains) - Total: 83 markdown files now organized by purpose **New Content:** - Added comprehensive Environment Variable Reference to copilot-instructions.md - 100+ ENV variables documented with types, defaults, purpose, notes - Organized by category: Required (Drift/RPC/Pyth), Trading Config (quality/ leverage/sizing), ATR System, Runner System, Risk Limits, Notifications, etc. - Includes usage examples (correct vs wrong patterns) **File Distribution:** - docs/analysis/ - Performance analyses, blocked signals, profit projections - docs/architecture/ - Adaptive leverage, ATR trailing, indicator tracking - docs/bugs/ - CRITICAL_*.md, FIXES_*.md bug reports (7 files) - docs/cluster/ - EPYC setup, distributed computing docs (3 files) - docs/deployments/ - *_COMPLETE.md, DEPLOYMENT_*.md status (12 files) - docs/roadmaps/ - All *ROADMAP*.md strategic planning files (7 files) - docs/setup/ - TradingView guides, signal quality, n8n setup (8 files) - docs/archived/2025_pre_nov/ - Obsolete verification checklist (1 file) **Key Improvements:** - ENV variable reference: Single source of truth for all configuration - Common Pitfalls #68-71: Already complete, verified during audit - Better findability: Category-based navigation vs 68 files in root - Preserves history: All files git mv (rename), not copy/delete - Zero broken functionality: Only documentation moved, no code changes **Verification:** - 83 markdown files now in docs/ subdirectories - Root directory cleaned: 68 files → 0 files (except README.md) - Git history preserved for all moved files - Container running: trading-bot-v4 (no restart needed) **Next Steps:** - Create README.md files in each docs subdirectory - Add navigation index - Update main README.md with new structure - Consolidate duplicate deployment docs - Archive truly obsolete files (old SQL backups) See: docs/analysis/CLEANUP_PLAN.md for complete reorganization strategy
3.6 KiB
TradingView Alert - EASIEST METHOD
Since you don't have "time()" in the condition dropdown, we'll use a Pine Script indicator instead. This is actually easier!
STEP 1: Add the Pine Script Indicator
-
On your SOLUSDT 5-minute chart, click the Pine Editor button at bottom
- Or go to: Pine Editor tab at the bottom of the screen
-
Delete everything in the editor
-
Copy and paste this entire script:
//@version=5
indicator("Market Data Alert", overlay=false)
// Calculate metrics
atr_value = ta.atr(14)
adx_value = ta.dmi(14, 14)
rsi_value = ta.rsi(close, 14)
volume_ratio = volume / ta.sma(volume, 20)
price_position = (close - ta.lowest(low, 100)) / (ta.highest(high, 100) - ta.lowest(low, 100)) * 100
// Plot something so indicator appears
plot(1, "Signal", color=color.green)
// Alert condition
alertcondition(true, title="Market Data", message='{"action":"market_data","symbol":"{{ticker}}","timeframe":"{{interval}}","atr":' + str.tostring(atr_value) + ',"adx":' + str.tostring(adx_value) + ',"rsi":' + str.tostring(rsi_value) + ',"volumeRatio":' + str.tostring(volume_ratio) + ',"pricePosition":' + str.tostring(price_position) + ',"currentPrice":' + str.tostring(close) + '}')
-
Click "Save" button
- Name it:
Market Data Alert
- Name it:
-
Click "Add to Chart" button
You should now see a new indicator panel at the bottom of your chart.
STEP 2: Create the Alert (NOW IT'S EASY!)
-
Right-click on the indicator name in the legend (where it says "Market Data Alert")
-
Select "Add Alert on Market Data Alert"
OR
-
Click the Alert icon 🔔 (or press ALT + A)
-
In the Condition dropdown, you should now see:
- "Market Data Alert" → Select this
- Then select: "Market Data" (the alert condition name)
-
Settings section:
| Setting | Value |
|---|---|
| Webhook URL | http://10.0.0.48:3001/api/trading/market-data |
| Alert name | Market Data - SOL 5min |
| Frequency | Once Per Bar Close |
| Expiration | Never |
-
Notifications:
- ✅ Webhook URL (ONLY this one checked)
- ❌ Uncheck everything else
-
Alert message:
- Leave it as default (the script handles the message)
- OR if there's a message field, it should already have the JSON
-
Click "Create"
STEP 3: Repeat for ETH and BTC
- Open ETHUSDT 5-minute chart
- Add the same indicator (Pine Editor → paste script → Save → Add to Chart)
- Create alert on the indicator
- Webhook URL:
http://10.0.0.48:3001/api/trading/market-data - Name:
Market Data - ETH 5min
Repeat for BTCUSDT.
✅ VERIFY (Wait 5 Minutes)
curl http://localhost:3001/api/trading/market-data
Should show all 3 symbols with fresh data.
🎯 Why This Method is Better
- ✅ Works on all TradingView plans (that support indicators)
- ✅ Easier to set up (no complex condition configuration)
- ✅ Message is built-in (less copy-paste errors)
- ✅ Visual feedback (shows metrics on chart)
- ✅ Reusable (same indicator for all symbols)
🐛 Troubleshooting
"Pine Editor not available"
- You need TradingView Pro/Premium for custom scripts
- Alternative: Use the "Crossing" method below
Alternative without Pine Script:
- Condition: Price
- Trigger: Crossing up
- Value: Any value
- Check: "Only once per bar close"
- Message: Use the JSON from
QUICK_SETUP_CARD.md
This will fire less frequently but still works.
Try the Pine Script method first - it's the cleanest solution! 🚀