Spaces:
Sleeping
Sleeping
Commit Β·
2b58c4b
1
Parent(s): dfb1abc
Rebrand to BiasBuster + Fix fetch errors for remote deployment
Browse files- README.md +36 -19
- forex_macd_dashboard.html +27 -9
README.md
CHANGED
|
@@ -1,31 +1,48 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
#
|
| 11 |
|
| 12 |
-
<!-- Last updated: 2025-12-25
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
## Features
|
| 17 |
-
- MACD-based trading signals
|
| 18 |
-
- Static HTML dashboard
|
| 19 |
-
- JSON-based signal updates
|
| 20 |
-
- Runs on Hugging Face Spaces using Docker
|
| 21 |
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
- Runs on port **7860** (Hugging Face requirement)
|
| 26 |
|
| 27 |
-
## Files
|
| 28 |
-
|
| 29 |
-
- `
|
| 30 |
-
- `
|
| 31 |
-
- `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: BiasBuster
|
| 3 |
+
emoji: π―
|
| 4 |
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# BiasBuster - Multi-Market Trading Dashboard
|
| 11 |
|
| 12 |
+
<!-- Last updated: 2025-12-25 23:00 IST -->
|
| 13 |
|
| 14 |
+
**BiasBuster** is a comprehensive live trading dashboard that provides real-time signals across multiple markets using MACD-based technical analysis combined with multi-timeframe confirmation.
|
| 15 |
|
| 16 |
+
## π Features
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
- **Multi-Market Coverage**: Forex, NSE Futures, Indian Stocks, Commodities (MCX), Crypto, and Metals/Energy
|
| 19 |
+
- **Advanced Signal System**: MACD-based signals with 3-tier Take Profit and Trailing Stop Loss
|
| 20 |
+
- **Real-Time Updates**: Live price tracking and signal generation
|
| 21 |
+
- **Re-entry Opportunities**: Smart detection of favorable re-entry points
|
| 22 |
+
- **Mobile-Optimized**: Responsive design for trading on the go
|
| 23 |
+
- **Signal History**: Complete trade tracking and performance analytics
|
| 24 |
+
|
| 25 |
+
## π How It Works
|
| 26 |
+
|
| 27 |
+
- Lightweight Python HTTP server serves the dashboard
|
| 28 |
+
- Real-time data fetched from Yahoo Finance
|
| 29 |
+
- MACD analysis across multiple timeframes (1D, 4H, 1H/15M)
|
| 30 |
+
- Automatic signal generation and lifecycle management
|
| 31 |
- Runs on port **7860** (Hugging Face requirement)
|
| 32 |
|
| 33 |
+
## π Key Files
|
| 34 |
+
|
| 35 |
+
- `serve_forex_macd.py` β HTTP server with API endpoints
|
| 36 |
+
- `forex_macd_dashboard.html` β Responsive UI
|
| 37 |
+
- `forex_macd_signals.json` β Live trading signals
|
| 38 |
+
- `forex_macd_strategy.py` β Signal generation engine
|
| 39 |
+
- `Dockerfile` β Deployment configuration
|
| 40 |
+
|
| 41 |
+
## π‘ Markets Covered
|
| 42 |
+
|
| 43 |
+
- **Forex**: Major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.)
|
| 44 |
+
- **NSE Live**: Nifty & Bank Nifty Futures with auto-rollover
|
| 45 |
+
- **Indian Stocks**: Top Nifty 50 stocks
|
| 46 |
+
- **Commodities**: MCX Gold, Silver, Crude Oil, Natural Gas
|
| 47 |
+
- **Crypto**: BTC/USD, ETH/USD
|
| 48 |
+
- **Metals/Energy**: US Oil, Gold, Silver futures
|
forex_macd_dashboard.html
CHANGED
|
@@ -950,8 +950,11 @@
|
|
| 950 |
// Global error handler
|
| 951 |
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
| 952 |
const debug = document.getElementById('debugInfo');
|
| 953 |
-
debug
|
| 954 |
-
|
|
|
|
|
|
|
|
|
|
| 955 |
return false;
|
| 956 |
};
|
| 957 |
|
|
@@ -1027,27 +1030,39 @@
|
|
| 1027 |
if (signalsRes.ok) {
|
| 1028 |
cachedData = await signalsRes.json();
|
| 1029 |
lastFetchTimes.signals = Date.now();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1030 |
} else {
|
| 1031 |
throw new Error(`Failed to fetch signals: ${signalsRes.status}`);
|
| 1032 |
}
|
| 1033 |
|
| 1034 |
-
// Fetch visitor count
|
| 1035 |
try {
|
| 1036 |
-
const visitorRes = await fetch('/api/visitor-count'
|
|
|
|
|
|
|
| 1037 |
if (visitorRes.ok) {
|
| 1038 |
const stats = await visitorRes.json();
|
| 1039 |
document.getElementById('visitorCount').textContent = stats.unique;
|
| 1040 |
document.getElementById('activeCount').textContent = stats.active;
|
| 1041 |
}
|
| 1042 |
} catch (vErr) {
|
| 1043 |
-
|
|
|
|
|
|
|
| 1044 |
}
|
| 1045 |
|
| 1046 |
renderDashboard();
|
| 1047 |
} catch (error) {
|
| 1048 |
console.error('Error fetching data:', error);
|
| 1049 |
-
debug
|
| 1050 |
-
|
|
|
|
|
|
|
|
|
|
| 1051 |
}
|
| 1052 |
}
|
| 1053 |
|
|
@@ -1380,8 +1395,11 @@
|
|
| 1380 |
} catch (err) {
|
| 1381 |
console.error('Render error:', err);
|
| 1382 |
const debug = document.getElementById('debugInfo');
|
| 1383 |
-
debug
|
| 1384 |
-
|
|
|
|
|
|
|
|
|
|
| 1385 |
}
|
| 1386 |
}
|
| 1387 |
|
|
|
|
| 950 |
// Global error handler
|
| 951 |
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
| 952 |
const debug = document.getElementById('debugInfo');
|
| 953 |
+
if (debug) {
|
| 954 |
+
debug.style.display = 'block';
|
| 955 |
+
// Replace instead of append to avoid accumulation
|
| 956 |
+
debug.textContent = `β οΈ JavaScript Error: ${msg}\nLine: ${lineNo}\nCol: ${columnNo}\n`;
|
| 957 |
+
}
|
| 958 |
return false;
|
| 959 |
};
|
| 960 |
|
|
|
|
| 1030 |
if (signalsRes.ok) {
|
| 1031 |
cachedData = await signalsRes.json();
|
| 1032 |
lastFetchTimes.signals = Date.now();
|
| 1033 |
+
|
| 1034 |
+
// Hide debug panel on successful fetch
|
| 1035 |
+
if (debug) {
|
| 1036 |
+
debug.style.display = 'none';
|
| 1037 |
+
}
|
| 1038 |
} else {
|
| 1039 |
throw new Error(`Failed to fetch signals: ${signalsRes.status}`);
|
| 1040 |
}
|
| 1041 |
|
| 1042 |
+
// Fetch visitor count (optional - gracefully fail if not available)
|
| 1043 |
try {
|
| 1044 |
+
const visitorRes = await fetch('/api/visitor-count', {
|
| 1045 |
+
signal: AbortSignal.timeout(3000) // 3 second timeout
|
| 1046 |
+
});
|
| 1047 |
if (visitorRes.ok) {
|
| 1048 |
const stats = await visitorRes.json();
|
| 1049 |
document.getElementById('visitorCount').textContent = stats.unique;
|
| 1050 |
document.getElementById('activeCount').textContent = stats.active;
|
| 1051 |
}
|
| 1052 |
} catch (vErr) {
|
| 1053 |
+
// Silently fail for visitor count - it's optional
|
| 1054 |
+
// Only log to console, don't show to user
|
| 1055 |
+
console.debug('Visitor count unavailable (expected on remote deployments)');
|
| 1056 |
}
|
| 1057 |
|
| 1058 |
renderDashboard();
|
| 1059 |
} catch (error) {
|
| 1060 |
console.error('Error fetching data:', error);
|
| 1061 |
+
if (debug) {
|
| 1062 |
+
debug.style.display = 'block';
|
| 1063 |
+
// Clear previous errors and show only the latest
|
| 1064 |
+
debug.textContent = `β οΈ Signal Fetch Error: ${error.message}\n\nRetrying automatically...\n`;
|
| 1065 |
+
}
|
| 1066 |
}
|
| 1067 |
}
|
| 1068 |
|
|
|
|
| 1395 |
} catch (err) {
|
| 1396 |
console.error('Render error:', err);
|
| 1397 |
const debug = document.getElementById('debugInfo');
|
| 1398 |
+
if (debug) {
|
| 1399 |
+
debug.style.display = 'block';
|
| 1400 |
+
// Replace instead of append to avoid accumulation
|
| 1401 |
+
debug.textContent = `β οΈ Render Error: ${err.message}\n\nPlease refresh the page.\n`;
|
| 1402 |
+
}
|
| 1403 |
}
|
| 1404 |
}
|
| 1405 |
|