dixitramjendra commited on
Commit
2b58c4b
Β·
1 Parent(s): dfb1abc

Rebrand to BiasBuster + Fix fetch errors for remote deployment

Browse files
Files changed (2) hide show
  1. README.md +36 -19
  2. forex_macd_dashboard.html +27 -9
README.md CHANGED
@@ -1,31 +1,48 @@
1
  ---
2
- title: Forex MACD Dashboard
3
- emoji: πŸ“ˆ
4
  colorFrom: blue
5
- colorTo: green
6
  sdk: docker
7
  pinned: false
8
  ---
9
 
10
- # Forex MACD Dashboard
11
 
12
- <!-- Last updated: 2025-12-25 15:19 IST -->
13
 
14
- This Space serves a live Forex MACD trading dashboard using a lightweight Python HTTP server.
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
- ## How it works
23
- - Python `http.server` serves the dashboard
24
- - Dashboard reads `forex_macd_signals.json`
 
 
 
 
 
 
 
 
 
 
25
  - Runs on port **7860** (Hugging Face requirement)
26
 
27
- ## Files
28
- - `serve_forex_macd.py` – HTTP server
29
- - `forex_macd_dashboard.html` – UI
30
- - `forex_macd_signals.json` – Trading signals
31
- - `Dockerfile` – Deployment config
 
 
 
 
 
 
 
 
 
 
 
 
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.style.display = 'block';
954
- debug.textContent += `ERROR: ${msg}\nLine: ${lineNo}\nCol: ${columnNo}\n\n`;
 
 
 
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
- console.error('Visitor fetch error:', vErr);
 
 
1044
  }
1045
 
1046
  renderDashboard();
1047
  } catch (error) {
1048
  console.error('Error fetching data:', error);
1049
- debug.style.display = 'block';
1050
- debug.textContent += `Fetch Error: ${error.message}\n`;
 
 
 
1051
  }
1052
  }
1053
 
@@ -1380,8 +1395,11 @@
1380
  } catch (err) {
1381
  console.error('Render error:', err);
1382
  const debug = document.getElementById('debugInfo');
1383
- debug.style.display = 'block';
1384
- debug.textContent += `Render Error: ${err.message}\n`;
 
 
 
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