Customize - Stock map list, watch list, home page
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user