voly 0.0.28__tar.gz → 0.0.29__tar.gz
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.
- {voly-0.0.28/src/voly.egg-info → voly-0.0.29}/PKG-INFO +1 -1
- {voly-0.0.28 → voly-0.0.29}/pyproject.toml +2 -2
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/charts.py +12 -8
- {voly-0.0.28 → voly-0.0.29/src/voly.egg-info}/PKG-INFO +1 -1
- {voly-0.0.28 → voly-0.0.29}/LICENSE +0 -0
- {voly-0.0.28 → voly-0.0.29}/README.md +0 -0
- {voly-0.0.28 → voly-0.0.29}/setup.cfg +0 -0
- {voly-0.0.28 → voly-0.0.29}/setup.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/__init__.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/client.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/__init__.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/data.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/fit.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/core/rnd.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/exceptions.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/formulas.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/models.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly/utils/logger.py +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.28 → voly-0.0.29}/src/voly.egg-info/top_level.txt +0 -0
- {voly-0.0.28 → voly-0.0.29}/tests/test_client.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "voly"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.29"
|
|
8
8
|
description = "Options & volatility research package"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -60,7 +60,7 @@ line_length = 100
|
|
|
60
60
|
multi_line_output = 3
|
|
61
61
|
|
|
62
62
|
[tool.mypy]
|
|
63
|
-
python_version = "0.0.
|
|
63
|
+
python_version = "0.0.29"
|
|
64
64
|
warn_return_any = true
|
|
65
65
|
warn_unused_configs = true
|
|
66
66
|
disallow_untyped_defs = true
|
|
@@ -13,6 +13,9 @@ from voly.models import SVIModel
|
|
|
13
13
|
import plotly.graph_objects as go
|
|
14
14
|
from plotly.subplots import make_subplots
|
|
15
15
|
import plotly.io as pio
|
|
16
|
+
import plotly.express as px
|
|
17
|
+
from plotly.colors import hex_to_rgb, make_colorscale
|
|
18
|
+
|
|
16
19
|
|
|
17
20
|
# Set default renderer to browser for interactive plots
|
|
18
21
|
pio.renderers.default = "browser"
|
|
@@ -46,7 +49,7 @@ def plot_volatility_smile(moneyness: np.ndarray,
|
|
|
46
49
|
y=iv * 100, # Convert to percentage
|
|
47
50
|
mode='lines',
|
|
48
51
|
name='Model',
|
|
49
|
-
line=dict(color='#
|
|
52
|
+
line=dict(color='#0080FF', width=2)
|
|
50
53
|
)
|
|
51
54
|
)
|
|
52
55
|
|
|
@@ -344,19 +347,20 @@ def plot_fit_performance(fit_performance: pd.DataFrame) -> go.Figure:
|
|
|
344
347
|
|
|
345
348
|
@catch_exception
|
|
346
349
|
def plot_3d_surface(moneyness_grid: np.ndarray,
|
|
347
|
-
iv_surface:
|
|
350
|
+
iv_surface: dict[float, np.ndarray]) -> go.Figure:
|
|
348
351
|
"""
|
|
349
352
|
Plot 3D implied volatility surface.
|
|
350
353
|
|
|
351
354
|
Parameters:
|
|
352
|
-
-
|
|
355
|
+
- moneyness_grid: grid of moneyness values
|
|
353
356
|
- iv_surface: Dictionary mapping expiry times to IV arrays
|
|
354
|
-
- title: Plot title
|
|
355
357
|
|
|
356
358
|
Returns:
|
|
357
359
|
- Plotly figure
|
|
358
360
|
"""
|
|
359
|
-
|
|
361
|
+
start_color = '#0080FF'
|
|
362
|
+
end_color = '#004080' # Darker blue
|
|
363
|
+
custom_blue_scale = [[0, start_color], [1, end_color]]
|
|
360
364
|
yte_values = list(iv_surface.keys())
|
|
361
365
|
|
|
362
366
|
# Convert implied volatility surface to array
|
|
@@ -366,12 +370,12 @@ def plot_3d_surface(moneyness_grid: np.ndarray,
|
|
|
366
370
|
X, Y = np.meshgrid(moneyness_grid, yte_values)
|
|
367
371
|
Z = z_array * 100 # Convert to percentage
|
|
368
372
|
|
|
369
|
-
# Create 3D surface plot
|
|
370
|
-
fig = go.Figure(data=[go.Surface(z=Z, x=X, y=Y, colorscale=
|
|
373
|
+
# Create 3D surface plot with custom blue colorscale
|
|
374
|
+
fig = go.Figure(data=[go.Surface(z=Z, x=X, y=Y, colorscale=custom_blue_scale)])
|
|
371
375
|
|
|
372
376
|
# Add colorbar
|
|
373
377
|
fig.update_traces(contours_z=dict(show=True, usecolormap=True,
|
|
374
|
-
highlightcolor="
|
|
378
|
+
highlightcolor="#0080FF", project_z=True))
|
|
375
379
|
|
|
376
380
|
# Update layout
|
|
377
381
|
fig.update_layout(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|