mirror of
https://github.com/shawnkim1997/All-in-one-Financial-Analysis.git
synced 2026-08-23 23:58:03 +00:00
- Add missing numpy, scipy, dbnomics to requirements.txt (fixes ImportError on fresh install) - Sync claude.md with actual codebase: §3 file structure (37 services, 21 routers), §5 API endpoints (92 routes), §6 frontend pages (12), §13 TODO status - Update README.md with current architecture (92 API routes, 21 routers, 37 services), multi-asset overview, research grid, macro dashboard, screener+backtest, multi-jurisdiction filings, and 2026-03-26 changelog entry - Add new routers: dart, edinet, fmp, macro, research - Add new services: cache, dart_fetcher, dart_filing_service, economic_calendar, ecos_fetcher, edinet_filing_service, fmp_client, global_macro_quadrant, kpi_history_service, macro_cycle, macro_fetcher, oecd_cycle, peer_comparison_service, research_dashboard, smart_money_service, yield_fx_service - Add new frontend: macro page, screener+backtest, research grid components, overview (Equity/ETF/Commodity), filings (SEC/DART/EDINET), error boundaries - Remove 6 unused services: copilot_context, crypto_fetcher, fx_fetcher, gemini_analysis, market_data, technical_analysis - Remove obsolete docs: .agent/, AGENT.md, ATLAS_EVALUATION.md, docs/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""Screener and backtesting router."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.post("/search")
|
|
async def search_stocks(filters: dict):
|
|
"""Run stock screener with simple filters."""
|
|
try:
|
|
from server.services.screener import run_screener
|
|
|
|
return await run_screener(filters)
|
|
except Exception as e:
|
|
return {"error": str(e), "data": []}
|
|
|
|
|
|
@router.post("/backtest")
|
|
async def backtest(body: dict):
|
|
"""Run strategy backtest for one ticker."""
|
|
try:
|
|
from server.services.backtester import run_backtest
|
|
|
|
return await run_backtest(
|
|
ticker=body.get("ticker", ""),
|
|
strategy=body.get("strategy", "buy_and_hold"),
|
|
start_date=body.get("start_date", "2024-01-01"),
|
|
end_date=body.get("end_date", "2026-01-01"),
|
|
initial_capital=float(body.get("initial_capital", 10000.0)),
|
|
benchmark_ticker=str(body.get("benchmark_ticker") or "SPY"),
|
|
rebalance_months=body.get("rebalance_months"),
|
|
)
|
|
except Exception as e:
|
|
return {"error": str(e)}
|