dixitramjendra commited on
Commit
a6d5c77
ยท
1 Parent(s): d807fba

Renamed Forex Live Signal to Live Signal - show all active signals across instruments

Browse files
Files changed (1) hide show
  1. forex_macd_dashboard.html +9 -9
forex_macd_dashboard.html CHANGED
@@ -911,9 +911,9 @@
911
  </header>
912
 
913
  <div class="tabs-container" id="tabs">
914
- <button class="tab-btn active" onclick="filterCategory('NSE Live')">๐Ÿ‡ฎ๐Ÿ‡ณ NSE Live</button>
 
915
  <button class="tab-btn" onclick="filterCategory('World Index')">๐ŸŒŽ World Index</button>
916
- <button class="tab-btn" onclick="filterCategory('ForexLive')">Forex Live Signal</button>
917
  <button class="tab-btn" onclick="filterCategory('Indian Indices & Commodities')">๐Ÿญ Commodities
918
  Live</button>
919
  <button class="tab-btn" onclick="filterCategory('Crypto Scalping')">๐Ÿ’ฐ Crypto Live</button>
@@ -1000,7 +1000,7 @@
1000
  return `<div class="lifecycle-badge ${badge.class}">${badge.emoji} ${badge.text}</div>`;
1001
  }
1002
 
1003
- let currentCategory = 'ForexLive';
1004
  let cachedData = null;
1005
  let selectedHistoryDate = null;
1006
  let lastFetchTimes = {
@@ -1014,11 +1014,11 @@
1014
 
1015
  async function fetchData(force = false) {
1016
  const now = Date.now();
1017
- const isOtherTab = currentCategory !== 'ForexLive';
1018
 
1019
  // Only fetch if forced, or if it's the Active tab (10s), or if 15m passed for other tabs
1020
  if (!force) {
1021
- const interval = (currentCategory === 'ForexLive') ? SYNC_INTERVAL_ACTIVE : SYNC_INTERVAL_OTHER;
1022
  if (now - lastFetchTimes.signals < interval) {
1023
  return;
1024
  }
@@ -1075,7 +1075,7 @@
1075
  buttons.forEach(btn => {
1076
  const btnText = btn.textContent.trim();
1077
  if (btnText === category ||
1078
- (category === 'ForexLive' && btnText === 'Forex Live Signal') ||
1079
  (category === 'History' && btnText === 'Signal History') ||
1080
  (category === 'Crypto Scalping' && btnText.includes('Crypto Live')) ||
1081
  (category === 'NSE Live' && btnText.includes('NSE Live')) ||
@@ -1124,9 +1124,9 @@
1124
  console.log('Total instruments:', data.data.length);
1125
  console.log('Current category:', currentCategory);
1126
 
1127
- if (currentCategory === 'ForexLive') {
1128
- // Show only Forex instruments with active signals
1129
- filteredData = data.data.filter(inst => inst.signal !== null && inst.category === 'Forex');
1130
  } else if (currentCategory === 'NSELive') {
1131
  // Show only NSE Live futures
1132
  filteredData = data.data.filter(inst => inst.category === 'NSE Live');
 
911
  </header>
912
 
913
  <div class="tabs-container" id="tabs">
914
+ <button class="tab-btn active" onclick="filterCategory('LiveSignal')">๐Ÿ”ด Live Signal</button>
915
+ <button class="tab-btn" onclick="filterCategory('NSE Live')">๐Ÿ‡ฎ๐Ÿ‡ณ NSE Live</button>
916
  <button class="tab-btn" onclick="filterCategory('World Index')">๐ŸŒŽ World Index</button>
 
917
  <button class="tab-btn" onclick="filterCategory('Indian Indices & Commodities')">๐Ÿญ Commodities
918
  Live</button>
919
  <button class="tab-btn" onclick="filterCategory('Crypto Scalping')">๐Ÿ’ฐ Crypto Live</button>
 
1000
  return `<div class="lifecycle-badge ${badge.class}">${badge.emoji} ${badge.text}</div>`;
1001
  }
1002
 
1003
+ let currentCategory = 'LiveSignal';
1004
  let cachedData = null;
1005
  let selectedHistoryDate = null;
1006
  let lastFetchTimes = {
 
1014
 
1015
  async function fetchData(force = false) {
1016
  const now = Date.now();
1017
+ const isOtherTab = currentCategory !== 'LiveSignal';
1018
 
1019
  // Only fetch if forced, or if it's the Active tab (10s), or if 15m passed for other tabs
1020
  if (!force) {
1021
+ const interval = (currentCategory === 'LiveSignal') ? SYNC_INTERVAL_ACTIVE : SYNC_INTERVAL_OTHER;
1022
  if (now - lastFetchTimes.signals < interval) {
1023
  return;
1024
  }
 
1075
  buttons.forEach(btn => {
1076
  const btnText = btn.textContent.trim();
1077
  if (btnText === category ||
1078
+ (category === 'LiveSignal' && btnText.includes('Live Signal')) ||
1079
  (category === 'History' && btnText === 'Signal History') ||
1080
  (category === 'Crypto Scalping' && btnText.includes('Crypto Live')) ||
1081
  (category === 'NSE Live' && btnText.includes('NSE Live')) ||
 
1124
  console.log('Total instruments:', data.data.length);
1125
  console.log('Current category:', currentCategory);
1126
 
1127
+ if (currentCategory === 'LiveSignal') {
1128
+ // Show ALL instruments with active signals across all categories
1129
+ filteredData = data.data.filter(inst => inst.signal !== null);
1130
  } else if (currentCategory === 'NSELive') {
1131
  // Show only NSE Live futures
1132
  filteredData = data.data.filter(inst => inst.category === 'NSE Live');