sigma-terminal 3.4.0__py3-none-any.whl → 3.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sigma/__init__.py +4 -5
- sigma/analytics/__init__.py +11 -9
- sigma/app.py +384 -1125
- sigma/backtest/__init__.py +2 -0
- sigma/backtest/service.py +116 -0
- sigma/charts.py +2 -2
- sigma/cli.py +15 -13
- sigma/comparison.py +2 -2
- sigma/config.py +25 -12
- sigma/core/command_router.py +93 -0
- sigma/llm/__init__.py +3 -0
- sigma/llm/providers/anthropic_provider.py +196 -0
- sigma/llm/providers/base.py +29 -0
- sigma/llm/providers/google_provider.py +197 -0
- sigma/llm/providers/ollama_provider.py +156 -0
- sigma/llm/providers/openai_provider.py +168 -0
- sigma/llm/providers/sigma_cloud_provider.py +57 -0
- sigma/llm/rate_limit.py +40 -0
- sigma/llm/registry.py +66 -0
- sigma/llm/router.py +122 -0
- sigma/setup_agent.py +188 -0
- sigma/tools/__init__.py +23 -0
- sigma/tools/adapter.py +38 -0
- sigma/{tools.py → tools/library.py} +593 -1
- sigma/tools/registry.py +108 -0
- sigma/utils/extraction.py +83 -0
- sigma_terminal-3.5.0.dist-info/METADATA +184 -0
- sigma_terminal-3.5.0.dist-info/RECORD +46 -0
- sigma/llm.py +0 -786
- sigma/setup.py +0 -440
- sigma_terminal-3.4.0.dist-info/METADATA +0 -264
- sigma_terminal-3.4.0.dist-info/RECORD +0 -30
- /sigma/{backtest.py → backtest/simple_engine.py} +0 -0
- {sigma_terminal-3.4.0.dist-info → sigma_terminal-3.5.0.dist-info}/WHEEL +0 -0
- {sigma_terminal-3.4.0.dist-info → sigma_terminal-3.5.0.dist-info}/entry_points.txt +0 -0
- {sigma_terminal-3.4.0.dist-info → sigma_terminal-3.5.0.dist-info}/licenses/LICENSE +0 -0
sigma/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Sigma v3.
|
|
2
|
+
Sigma v3.5.0 - Finance Research Agent
|
|
3
3
|
|
|
4
4
|
An elite finance research agent combining:
|
|
5
5
|
- Multi-provider AI (Google Gemini, OpenAI, Anthropic, Groq, xAI, Ollama)
|
|
@@ -12,8 +12,8 @@ An elite finance research agent combining:
|
|
|
12
12
|
- Monitoring, alerts, and watchlists
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
__version__ = "3.
|
|
16
|
-
__author__ = "
|
|
15
|
+
__version__ = "3.5.0"
|
|
16
|
+
__author__ = "Desenyon"
|
|
17
17
|
|
|
18
18
|
# Core functionality
|
|
19
19
|
from .app import launch, SigmaApp
|
|
@@ -101,7 +101,7 @@ from .robustness import (
|
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
# Setup
|
|
104
|
-
from .
|
|
104
|
+
from .setup_agent import run_setup
|
|
105
105
|
|
|
106
106
|
__all__ = [
|
|
107
107
|
# Version
|
|
@@ -181,5 +181,4 @@ __all__ = [
|
|
|
181
181
|
|
|
182
182
|
# Setup
|
|
183
183
|
"run_setup",
|
|
184
|
-
"quick_setup",
|
|
185
184
|
]
|
sigma/analytics/__init__.py
CHANGED
|
@@ -34,10 +34,10 @@ class PerformanceAnalytics:
|
|
|
34
34
|
if n < 2:
|
|
35
35
|
return {}
|
|
36
36
|
|
|
37
|
-
#
|
|
38
|
-
total_return = (1 + returns).prod() - 1
|
|
37
|
+
# Helper to ensure numeric
|
|
38
|
+
total_return = float((1 + returns).prod() - 1) # type: ignore
|
|
39
39
|
cagr = (1 + total_return) ** (periods_per_year / n) - 1
|
|
40
|
-
volatility = returns.std() * np.sqrt(periods_per_year)
|
|
40
|
+
volatility = float(returns.std() * np.sqrt(periods_per_year)) # type: ignore
|
|
41
41
|
|
|
42
42
|
# Downside metrics
|
|
43
43
|
negative_returns = returns[returns < 0]
|
|
@@ -98,7 +98,7 @@ class PerformanceAnalytics:
|
|
|
98
98
|
alpha = cagr - (risk_free_rate + beta * (aligned.iloc[:, 1].mean() * periods_per_year - risk_free_rate))
|
|
99
99
|
|
|
100
100
|
# R-squared
|
|
101
|
-
correlation = aligned.corr().iloc[0, 1]
|
|
101
|
+
correlation = float(aligned.corr().iloc[0, 1]) # type: ignore
|
|
102
102
|
r_squared = correlation ** 2
|
|
103
103
|
|
|
104
104
|
# Tracking error
|
|
@@ -278,7 +278,8 @@ class SeasonalityAnalyzer:
|
|
|
278
278
|
@staticmethod
|
|
279
279
|
def monthly_seasonality(returns: pd.Series) -> Dict[int, Dict[str, float]]:
|
|
280
280
|
"""Analyze month-of-year seasonality."""
|
|
281
|
-
|
|
281
|
+
idx = pd.DatetimeIndex(returns.index)
|
|
282
|
+
monthly = returns.groupby(idx.month)
|
|
282
283
|
|
|
283
284
|
result = {}
|
|
284
285
|
for month in range(1, 13):
|
|
@@ -299,7 +300,8 @@ class SeasonalityAnalyzer:
|
|
|
299
300
|
@staticmethod
|
|
300
301
|
def day_of_week_seasonality(returns: pd.Series) -> Dict[int, Dict[str, float]]:
|
|
301
302
|
"""Analyze day-of-week seasonality."""
|
|
302
|
-
|
|
303
|
+
idx = pd.DatetimeIndex(returns.index)
|
|
304
|
+
daily = returns.groupby(idx.dayofweek)
|
|
303
305
|
|
|
304
306
|
day_names = {0: "Monday", 1: "Tuesday", 2: "Wednesday", 3: "Thursday", 4: "Friday"}
|
|
305
307
|
|
|
@@ -329,7 +331,7 @@ class SeasonalityAnalyzer:
|
|
|
329
331
|
post_returns = []
|
|
330
332
|
|
|
331
333
|
for event_date in event_dates:
|
|
332
|
-
event_idx = returns.index.get_indexer([event_date], method='nearest')[0]
|
|
334
|
+
event_idx = returns.index.get_indexer(pd.Index([event_date]), method='nearest')[0]
|
|
333
335
|
|
|
334
336
|
if event_idx >= pre_days and event_idx < len(returns) - post_days:
|
|
335
337
|
pre_ret = returns.iloc[event_idx - pre_days:event_idx].sum()
|
|
@@ -387,8 +389,8 @@ class FactorAnalyzer:
|
|
|
387
389
|
if len(aligned) < 30:
|
|
388
390
|
return {}
|
|
389
391
|
|
|
390
|
-
y = aligned["asset"].
|
|
391
|
-
X = aligned.drop("asset", axis=1).
|
|
392
|
+
y = aligned["asset"].to_numpy(dtype=float)
|
|
393
|
+
X = aligned.drop("asset", axis=1).to_numpy(dtype=float)
|
|
392
394
|
X = np.column_stack([np.ones(len(X)), X]) # Add intercept
|
|
393
395
|
|
|
394
396
|
# OLS regression
|