voly 0.0.40__py3-none-any.whl → 0.0.41__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.
- voly/core/charts.py +13 -16
 - {voly-0.0.40.dist-info → voly-0.0.41.dist-info}/METADATA +1 -1
 - {voly-0.0.40.dist-info → voly-0.0.41.dist-info}/RECORD +6 -6
 - {voly-0.0.40.dist-info → voly-0.0.41.dist-info}/LICENSE +0 -0
 - {voly-0.0.40.dist-info → voly-0.0.41.dist-info}/WHEEL +0 -0
 - {voly-0.0.40.dist-info → voly-0.0.41.dist-info}/top_level.txt +0 -0
 
    
        voly/core/charts.py
    CHANGED
    
    | 
         @@ -22,11 +22,11 @@ pio.renderers.default = "browser" 
     | 
|
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            @catch_exception
         
     | 
| 
       25 
     | 
    
         
            -
            def plot_volatility_smile( 
     | 
| 
       26 
     | 
    
         
            -
                                       
     | 
| 
       27 
     | 
    
         
            -
                                      market_data:  
     | 
| 
      
 25 
     | 
    
         
            +
            def plot_volatility_smile(moneyness_array: np.ndarray,
         
     | 
| 
      
 26 
     | 
    
         
            +
                                      iv_values: np.ndarray,
         
     | 
| 
      
 27 
     | 
    
         
            +
                                      market_data: pd.DataFrame = None,
         
     | 
| 
       28 
28 
     | 
    
         
             
                                      expiry: Optional[float] = None,
         
     | 
| 
       29 
     | 
    
         
            -
                                       
     | 
| 
      
 29 
     | 
    
         
            +
                                      ) -> go.Figure:
         
     | 
| 
       30 
30 
     | 
    
         
             
                """
         
     | 
| 
       31 
31 
     | 
    
         
             
                Plot volatility smile for a single expiry.
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
         @@ -45,8 +45,8 @@ def plot_volatility_smile(moneyness: np.ndarray, 
     | 
|
| 
       45 
45 
     | 
    
         
             
                # Add model curve
         
     | 
| 
       46 
46 
     | 
    
         
             
                fig.add_trace(
         
     | 
| 
       47 
47 
     | 
    
         
             
                    go.Scatter(
         
     | 
| 
       48 
     | 
    
         
            -
                        x= 
     | 
| 
       49 
     | 
    
         
            -
                        y= 
     | 
| 
      
 48 
     | 
    
         
            +
                        x=moneyness_array,
         
     | 
| 
      
 49 
     | 
    
         
            +
                        y=iv_values * 100,  # Convert to percentage
         
     | 
| 
       50 
50 
     | 
    
         
             
                        mode='lines',
         
     | 
| 
       51 
51 
     | 
    
         
             
                        name='Model',
         
     | 
| 
       52 
52 
     | 
    
         
             
                        line=dict(color='#0080FF', width=2)
         
     | 
| 
         @@ -79,15 +79,12 @@ def plot_volatility_smile(moneyness: np.ndarray, 
     | 
|
| 
       79 
79 
     | 
    
         
             
                        )
         
     | 
| 
       80 
80 
     | 
    
         
             
                    )
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
                        maturity_name = expiry_data['maturity_name'].iloc[0]
         
     | 
| 
       85 
     | 
    
         
            -
                        dte_value = expiry_data['dte'].iloc[0]
         
     | 
| 
       86 
     | 
    
         
            -
                        title = f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})'
         
     | 
| 
      
 82 
     | 
    
         
            +
                maturity_name = expiry_data['maturity_name'].iloc[0]
         
     | 
| 
      
 83 
     | 
    
         
            +
                dte_value = expiry_data['dte'].iloc[0]
         
     | 
| 
       87 
84 
     | 
    
         | 
| 
       88 
85 
     | 
    
         
             
                # Update layout
         
     | 
| 
       89 
86 
     | 
    
         
             
                fig.update_layout(
         
     | 
| 
       90 
     | 
    
         
            -
                    title= 
     | 
| 
      
 87 
     | 
    
         
            +
                    title=f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})',
         
     | 
| 
       91 
88 
     | 
    
         
             
                    xaxis_title='Log Moneyness',
         
     | 
| 
       92 
89 
     | 
    
         
             
                    yaxis_title='Implied Volatility (%)',
         
     | 
| 
       93 
90 
     | 
    
         
             
                    template='plotly_dark',
         
     | 
| 
         @@ -98,7 +95,7 @@ def plot_volatility_smile(moneyness: np.ndarray, 
     | 
|
| 
       98 
95 
     | 
    
         | 
| 
       99 
96 
     | 
    
         | 
| 
       100 
97 
     | 
    
         
             
            @catch_exception
         
     | 
| 
       101 
     | 
    
         
            -
            def plot_all_smiles( 
     | 
| 
      
 98 
     | 
    
         
            +
            def plot_all_smiles(moneyness_array: np.ndarray,
         
     | 
| 
       102 
99 
     | 
    
         
             
                                iv_surface: Dict[float, np.ndarray],
         
     | 
| 
       103 
100 
     | 
    
         
             
                                market_data: Optional[pd.DataFrame] = None) -> List[go.Figure]:
         
     | 
| 
       104 
101 
     | 
    
         
             
                """
         
     | 
| 
         @@ -120,8 +117,8 @@ def plot_all_smiles(moneyness: np.ndarray, 
     | 
|
| 
       120 
117 
     | 
    
         
             
                # Create a figure for each expiry
         
     | 
| 
       121 
118 
     | 
    
         
             
                for expiry in sorted_expiries:
         
     | 
| 
       122 
119 
     | 
    
         
             
                    fig = plot_volatility_smile(
         
     | 
| 
       123 
     | 
    
         
            -
                         
     | 
| 
       124 
     | 
    
         
            -
                         
     | 
| 
      
 120 
     | 
    
         
            +
                        moneyness_array=moneyness_array,
         
     | 
| 
      
 121 
     | 
    
         
            +
                        iv_values=iv_surface[expiry],
         
     | 
| 
       125 
122 
     | 
    
         
             
                        market_data=market_data,
         
     | 
| 
       126 
123 
     | 
    
         
             
                        expiry=expiry
         
     | 
| 
       127 
124 
     | 
    
         
             
                    )
         
     | 
| 
         @@ -383,7 +380,7 @@ def plot_3d_surface(moneyness_array: np.ndarray, 
     | 
|
| 
       383 
380 
     | 
    
         
             
                    template='plotly_dark',
         
     | 
| 
       384 
381 
     | 
    
         
             
                    scene=dict(
         
     | 
| 
       385 
382 
     | 
    
         
             
                        xaxis_title='Log Moneyness',
         
     | 
| 
       386 
     | 
    
         
            -
                        yaxis_title=' 
     | 
| 
      
 383 
     | 
    
         
            +
                        yaxis_title='Maturities',
         
     | 
| 
       387 
384 
     | 
    
         
             
                        zaxis_title='Implied Volatility (%)'
         
     | 
| 
       388 
385 
     | 
    
         
             
                    ),
         
     | 
| 
       389 
386 
     | 
    
         
             
                    margin=dict(l=65, r=50, b=65, t=90)
         
     | 
| 
         @@ -4,15 +4,15 @@ voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92 
     | 
|
| 
       4 
4 
     | 
    
         
             
            voly/formulas.py,sha256=7NQZtYWFT_VOyAVNQHLB5-8caGAdtzU8y8eFcYJsZn8,7256
         
     | 
| 
       5 
5 
     | 
    
         
             
            voly/models.py,sha256=YJ12aamLz_-aOni4Qm0_XV9u4bjKK3vfJz0J2gc1h0o,3565
         
     | 
| 
       6 
6 
     | 
    
         
             
            voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
         
     | 
| 
       7 
     | 
    
         
            -
            voly/core/charts.py,sha256 
     | 
| 
      
 7 
     | 
    
         
            +
            voly/core/charts.py,sha256=-pynPs7s7WPZUqQhBrxFvVnetEzeCNL2CVJmkSuhx9g,26597
         
     | 
| 
       8 
8 
     | 
    
         
             
            voly/core/data.py,sha256=Dfk-ByHpdteUiLXr0p-wRLr3VAmdyjdDBKwjwdTgCjA,9939
         
     | 
| 
       9 
9 
     | 
    
         
             
            voly/core/fit.py,sha256=O4PMihVWI1NIEFU4_RkKvT73p0Jk0tB-ot5moMXAW78,9950
         
     | 
| 
       10 
10 
     | 
    
         
             
            voly/core/interpolate.py,sha256=ztVIePJZOh-CIbn69wkh1JW2rKywNe2FEewRN0zcSAo,8185
         
     | 
| 
       11 
11 
     | 
    
         
             
            voly/core/rnd.py,sha256=8FTU-Qp9epW9yE4XSOdiFGIRXrGyXqF6mVgZn1NMvxk,11813
         
     | 
| 
       12 
12 
     | 
    
         
             
            voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
         
     | 
| 
       13 
13 
     | 
    
         
             
            voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
         
     | 
| 
       14 
     | 
    
         
            -
            voly-0.0. 
     | 
| 
       15 
     | 
    
         
            -
            voly-0.0. 
     | 
| 
       16 
     | 
    
         
            -
            voly-0.0. 
     | 
| 
       17 
     | 
    
         
            -
            voly-0.0. 
     | 
| 
       18 
     | 
    
         
            -
            voly-0.0. 
     | 
| 
      
 14 
     | 
    
         
            +
            voly-0.0.41.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
         
     | 
| 
      
 15 
     | 
    
         
            +
            voly-0.0.41.dist-info/METADATA,sha256=MOauUodPYfgz4Ie1_FAtCObTNfPIX2iUX8ZZ5AVr1H8,4092
         
     | 
| 
      
 16 
     | 
    
         
            +
            voly-0.0.41.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
         
     | 
| 
      
 17 
     | 
    
         
            +
            voly-0.0.41.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
         
     | 
| 
      
 18 
     | 
    
         
            +
            voly-0.0.41.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |