Customize - Stock map list, watch list, home page

This commit is contained in:
2026-08-05 23:51:18 +05:30
parent 076c4ff68f
commit 53ad1abb78
34 changed files with 1423 additions and 587 deletions

View File

@@ -425,12 +425,12 @@ def analyze(stock):
# =========================================
# ✅ API - FAST SCAN
# =========================================
def get_scan():
def get_scan(user_sector_map):
sector_output = {}
all_stocks = []
for sector, stocks in sector_map.items():
for sector, stocks in user_sector_map.items():
data = list(ThreadPoolExecutor(5).map(analyze, stocks))
data = [x for x in data if x]
@@ -536,26 +536,28 @@ def analyze_ribbon(stock):
return None
def get_ribbon():
def get_ribbon(user_sector_map):
results = []
for stocks in sector_map.values():
for sector, stocks in user_sector_map.items():
data = list(ThreadPoolExecutor(5).map(analyze_ribbon, stocks))
data = [x for x in data if x]
for x in data:
x["sector"] = sector
results.extend(data)
return results
def get_smartmoney():
def get_smartmoney(user_sector_map):
results = []
for sector, stocks in sector_map.items():
for sector, stocks in user_sector_map.items():
data = list(ThreadPoolExecutor(5).map(analyze, stocks))
data = [x for x in data if x]
for x in data:
x["sector"] = sector
results.extend(data)
@@ -575,15 +577,15 @@ def get_smartmoney():
"all": results
}
def get_trend():
def get_trend(user_sector_map):
results = []
for sector, stocks in sector_map.items():
for sector, stocks in user_sector_map.items():
data = list(ThreadPoolExecutor(5).map(analyze, stocks))
data = [x for x in data if x]
for x in data:
x["sector"] = sector
results.extend(data)
results.sort(