Commit Graph

364 Commits

Author SHA1 Message Date
ahmet guzererler e0b882ed75
Merge pull request #75 from aguzererler/optimize-sell-batching-17320376887335337420
 Batch database writes for portfolio SELL operations
2026-03-21 23:02:52 +01:00
ahmet guzererler 6aa7351d12
Merge pull request #74 from aguzererler/optimize-percentile-risk-metrics-3721557834418496366
 Optimize percentile calculation in risk metrics
2026-03-21 23:02:25 +01:00
ahmet guzererler 415ab75415
Merge pull request #73 from aguzererler/perf/optimize-team-filtering-5153644847450952095
 [optimize team filtering loop performance]
2026-03-21 23:01:11 +01:00
ahmet guzererler 28f35a54ed
Merge pull request #72 from aguzererler/fix-macro-bridge-concurrency-3956784745339794663
 Optimize synchronous API execution concurrency in macro_bridge.py
2026-03-21 22:58:14 +01:00
ahmet guzererler becac49192
Merge pull request #76 from aguzererler/perf-opt-df-cols-1934091478908671805
 Optimize DataFrame column lowercasing in stockstats_utils.py
2026-03-21 22:50:18 +01:00
google-labs-jules[bot] 1886391997 Optimize DataFrame column lowercasing in stockstats_utils.py
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 21:47:43 +00:00
ahmet guzererler 442b38dff4
Merge pull request #69 from aguzererler/copilot/review-financial-tools-implementation
Financial tools analysis doc and fix YoY revenue growth off-by-one
2026-03-21 22:41:55 +01:00
google-labs-jules[bot] 1ed46937d7 perf(portfolio): batch database writes during bulk SELL executions
Replaces the O(N) database operations in the `TradeExecutor`'s
`execute_decisions` SELL loop with a single `batch_remove_holdings`
call to the repository. The new repository method calculates updates
in memory, resolves duplicate operations on the same ticker, and issues
the updates via newly implemented `psycopg2.extras.execute_batch`
routines on the `SupabaseClient`.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 20:06:45 +00:00
google-labs-jules[bot] e14d07ea81 perf(risk_metrics): optimize _percentile using heapq
Optimize the _percentile calculation to use heapq.nsmallest or heapq.nlargest when requesting small extreme percentiles (like 5% VaR) from large lists, falling back to sorted() only when necessary. This avoids fully sorting the entire array.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 20:05:29 +00:00
google-labs-jules[bot] 6d7e7c2944 Optimize team filtering loop performance
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 19:59:02 +00:00
google-labs-jules[bot] c39e34c389 Optimize synchronous API execution inside async loop in macro_bridge.py
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 19:56:23 +00:00
google-labs-jules[bot] f30a42ccab perf: optimize redundant iteration in get_completed_reports_count
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 19:51:52 +00:00
ahmet guzererler 01b892041b
Merge pull request #43 from aguzererler/copilot/update-portfolio-management-flow
docs: align portfolio flow with implementation, add token estimates and CLI reference
2026-03-21 20:50:57 +01:00
copilot-swe-agent[bot] c4a7108a76 Address code review: add debug logging for unknown method resolution
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/bb80e772-3e03-420e-bb0e-76cfdde14a04
2026-03-21 17:27:38 +00:00
copilot-swe-agent[bot] 92ebc13ce4 Add API consumption estimation module and CLI command
- New tradingagents/api_usage.py: Pre-run estimation of API calls per vendor
  for analyze, scan, and pipeline commands. Includes Alpha Vantage tier
  assessment (free: 25/day vs premium: 75/min).
- New CLI command: `estimate-api [analyze|scan|pipeline|all]`
- Enhanced observability: RunLogger.summary() now includes vendor_methods
  breakdown (vendor → method → call count)
- Enhanced CLI output: All 3 command summaries (analyze, scan, pipeline)
  now show per-vendor breakdown and Alpha Vantage assessment after runs
- 32 new tests in tests/unit/test_api_usage.py

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/bb80e772-3e03-420e-bb0e-76cfdde14a04
2026-03-21 17:25:26 +00:00
copilot-swe-agent[bot] a8ccff31a0 Add YoY edge case tests for 5 and 4 quarter scenarios
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/b594017b-ed84-4786-9b81-200a78eb5d76
2026-03-21 16:59:03 +00:00
copilot-swe-agent[bot] 3d76acf17d Add financial tools analysis doc and fix YoY revenue growth bug in TTM analysis
- Create docs/FINANCIAL_TOOLS_ANALYSIS.md with comprehensive 4-point analysis:
  1. Implementation accuracy review for all indicators and metrics
  2. Library assessment (stockstats vs TA-Lib vs pandas-ta)
  3. Alpha Vantage debate (local calc vs API-fetched)
  4. Data flow & API mapping for every financial tool
- Fix off-by-one in ttm_analysis.py: YoY revenue used quarterly[-4]
  (3 quarters back) instead of quarterly[-5] (4 quarters = 1 year back)
- Add test_revenue_yoy_is_four_quarters_back test to validate the fix

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/b594017b-ed84-4786-9b81-200a78eb5d76
2026-03-21 16:57:21 +00:00
ahmet guzererler a7b8c996f2
Merge pull request #70 from aguzererler/fix/resolve-prs-56-58-60-4650038896702716891
🧪 Resolve PRs #56, #58, and #60
2026-03-21 17:54:10 +01:00
google-labs-jules[bot] c8465af163 🧪 Resolve PRs #56, #58, and #60
- Added edge case test for `_find_col` in `tests/unit/test_ttm_analysis.py` (from PR #56).
- Enhanced `_clean_dataframe` in `tradingagents/dataflows/stockstats_utils.py` to parse dates, drop invalid rows, fill price gaps, and lowercase columns (combining PRs #58 and #60).
- Expanded the test suite in `tests/unit/test_stockstats_utils.py` to cover the new `_clean_dataframe` functionality.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 16:51:49 +00:00
copilot-swe-agent[bot] 5f3fbd5abd Initial plan 2026-03-21 16:47:43 +00:00
ahmet guzererler 68df103ee9
Merge pull request #52 from aguzererler/fix/remove-unused-import-interface-7009076599669968401
🧹 Remove unused Annotated import from interface.py
2026-03-21 17:37:18 +01:00
ahmet guzererler 9ef73577f3
Merge pull request #53 from aguzererler/jules-12150822204137850232-2d21567f
🧹 Remove unused import 'Path' from trading_graph.py
2026-03-21 17:36:57 +01:00
ahmet guzererler 2ec8a17216
Merge pull request #54 from aguzererler/test-macro-regime-fmt-pct-18208719821293052000
🧪 Add tests for `_fmt_pct` in macro regime
2026-03-21 17:36:20 +01:00
ahmet guzererler 7b9510a99b
Merge pull request #61 from aguzererler/fix/agent-utils-unused-imports-948671579039994874
🧹 fix: remove unused imports from agent_utils.py
2026-03-21 17:35:19 +01:00
ahmet guzererler 86a0f5d9b7
Merge pull request #59 from aguzererler/testing/industry-deep-dive-parsing-12762969703991793840
🧪 test: add tests and parsing logic for text formats in _extract_top_sectors
2026-03-21 17:34:47 +01:00
ahmet guzererler a42676d8b6
Merge pull request #57 from aguzererler/remove-unused-imports-alpha-vantage-5385473624944698804
🧹 [Code Health] Remove unused imports in alpha_vantage.py
2026-03-21 17:33:57 +01:00
ahmet guzererler ae83ce74fa
Merge pull request #55 from aguzererler/fix/refactor-alpha-vantage-indicator-4324081028548110342
🧹 Refactor long `get_indicator` function to improve maintainability
2026-03-21 17:32:31 +01:00
ahmet guzererler cce5755b30
Merge pull request #62 from aguzererler/test-stockstats-utils-15966200471023157106
🧪 [testing improvement] Add unit tests for _clean_dataframe in stockstats_utils
2026-03-21 17:29:41 +01:00
ahmet guzererler 4747d98cb3
Merge pull request #63 from aguzererler/fix/macro-regime-refactor-299016324797440021
🧹 Refactor classify_macro_regime to improve readability
2026-03-21 17:29:23 +01:00
ahmet guzererler e5be3f4676
Merge pull request #64 from aguzererler/perf/lazy-load-portfolio-snapshot-8090947574151242031
 [performance] Lazy Load JSON Parsing for PortfolioSnapshot Holdings
2026-03-21 17:28:43 +01:00
ahmet guzererler b0424a36d7
Merge pull request #66 from aguzererler/jules-17548469684748509551-99819dec
🧪 [Fix Finnhub API error handling and add coverage]
2026-03-21 17:27:49 +01:00
ahmet guzererler 0dc6236e20
Merge pull request #67 from aguzererler/testing/cli-extract-content-string-6775172434327225745
🧪 [Testing Improvement] Add tests for `extract_content_string` in `cli/main.py`
2026-03-21 17:27:21 +01:00
ahmet guzererler f2ec1bd6aa
Merge pull request #51 from aguzererler/test-vix-trend-short-history-13411679154947690802
🧪 [testing improvement] Add missing edge case test for short history in _signal_vix_trend
2026-03-21 17:26:42 +01:00
ahmet guzererler 5c91aa8bb3
Merge pull request #50 from aguzererler/test-ttm-analysis-find-col-8347777247783205733
🧪 Add unit tests for _find_col in ttm_analysis
2026-03-21 17:26:22 +01:00
ahmet guzererler e5dcfb0e25
Merge pull request #49 from aguzererler/test-extract-article-data-17131555993247333235
🧪 Improve test coverage for `_extract_article_data`
2026-03-21 17:25:19 +01:00
ahmet guzererler e292c833ce
Merge pull request #48 from aguzererler/fix/unused-typing-imports-8765363568869734056
🧹 Remove unused imports in trading_graph.py
2026-03-21 17:24:14 +01:00
ahmet guzererler 319feac087
Merge pull request #65 from aguzererler/testing-macro-regime-edge-cases-7674628334263228754
🧪 Fix VIX trend logic and add extensive tests for macro regime short history edge cases
2026-03-21 17:23:38 +01:00
ahmet guzererler 0313cc629e
Merge pull request #47 from aguzererler/fix/test-config-sum-constraints-edge-case-6454385375638160819
🧪 test: add edge case for portfolio config sum constraints
2026-03-21 17:20:25 +01:00
ahmet guzererler e877f298bb
Merge pull request #46 from aguzererler/fix-unused-import-finnhub-scanner-619852487739765853
🧹 remove unused import _make_api_request from finnhub_scanner.py
2026-03-21 17:20:03 +01:00
ahmet guzererler 5d600480ce
Merge pull request #45 from aguzererler/code-health/risk-manager-unused-import-1634631888147245992
🧹 Remove unused imports and variables in risk manager
2026-03-21 17:18:31 +01:00
ahmet guzererler 1e10b4ca96
Merge pull request #44 from aguzererler/fix/unused-import-finnhub-stock-10302219538878494092
🧹 Remove unused pandas import from finnhub_stock.py
2026-03-21 17:18:10 +01:00
ahmet guzererler df735bf6e9
Merge pull request #68 from aguzererler/feat/test-tool-call-parsing-12253012184888559232
🧪 Add robust parsing and tests for LLM string tool calls
2026-03-21 17:17:18 +01:00
google-labs-jules[bot] 6f052fffea 🧪 Implement robust tool call parsing and unit tests
- Replaced potentially unsafe or missing tool call parsing logic with `ast.literal_eval` in `cli/main.py`.
- Created a new `parse_tool_call` helper to handle fallback parsing for LLM tool calls formatted as strings.
- Added comprehensive unit tests in `tests/unit/test_cli_main_tools.py` verifying behavior for valid strings, `ValueError`, `SyntaxError`, dicts, and objects.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 14:56:12 +00:00
google-labs-jules[bot] 811459b38f Add tests for `extract_content_string` error handling in `cli/main.py`
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 14:53:45 +00:00
google-labs-jules[bot] bdaf188b33 Fix Finnhub API error handling and add coverage
Extracted the API request logic in `finnhub_news.py` to a private `_fetch_company_news_data` helper to properly catch `Exception` and return an empty list without violating the `str` return type of the main `get_company_news` function. Explicitly allows `ThirdPartyTimeoutError` to propagate to preserve timeout behavior.

Added corresponding tests to mock generic API exceptions and invalid response types. Retained the test verifying fallback behavior for invalid numeric values within `get_insider_transactions`.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 14:51:29 +00:00
google-labs-jules[bot] 177d35ede5 🧪 Fix VIX trend logic and add extensive tests for macro regime short history edge cases
- Fixed `_signal_vix_trend` to correctly return neutral for insufficient history (`< 21`).
- Added `test_short_history_is_neutral` to `TestSignalVixTrend`.
- Extended coverage for short history and edge cases in `TestSignalCreditSpread`, `TestSignalYieldCurve`, `TestSignalMarketBreadth`, and `TestSignalSectorRotation`.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 14:48:20 +00:00
CadeYu 7d200d834a style: inline single-use instrument context vars 2026-03-21 21:31:38 +08:00
CadeYu 08bfe70a69 fix: preserve exchange-qualified tickers across agent prompts 2026-03-21 21:10:13 +08:00
google-labs-jules[bot] 7ab7cd7591 perf: lazy load json parsing in PortfolioSnapshot
This commit optimizes `PortfolioSnapshot` instantiation when loaded from the DB or JSON dictionaries by removing the immediate `json.loads(holdings_snapshot)` parsing inside the `from_dict` constructor. Instead, it overrides `__getattribute__` to implement a lazy-loading pattern, where the `holdings_snapshot` string is only parsed into a Python dictionary the very first time the field is accessed.

    This optimization ensures that parsing large JSON payloads doesn't block the instantiation of snapshots, which is particularly beneficial in workflows that load a large historical series of snapshots but never access their `holdings_snapshot` field.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 08:32:52 +00:00
google-labs-jules[bot] 77694d49c9 Refactor classify_macro_regime into helper functions
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-21 08:31:07 +00:00