Update VIX estimation debug message to display actual symbol being used for volatility calculation
This commit is contained in:
1 parent
baa41d739a
commit
9059843460
1 file changed
+2
-2
+2
-2
@@ -406,8 +406,8 @@ def get_vix_level():
|
|||||||
debug_print(f"VIX from data: {vix:.2f}")
|
debug_print(f"VIX from data: {vix:.2f}")
|
||||||
return vix
|
return vix
|
||||||
else:
|
else:
|
||||||
debug_print("No VIX data, estimating from SPY volatility...")
|
debug_print(f"No VIX data, estimating from {SYMBOL} volatility...")
|
||||||
spy_bars = api.get_bars("SPY", "1Day", limit=20).df
|
spy_bars = api.get_bars(SYMBOL, "1Day", limit=20).df
|
||||||
if len(spy_bars) >= 20:
|
if len(spy_bars) >= 20:
|
||||||
spy_returns = spy_bars['close'].pct_change()
|
spy_returns = spy_bars['close'].pct_change()
|
||||||
volatility = spy_returns.std() * np.sqrt(252) * 100
|
volatility = spy_returns.std() * np.sqrt(252) * 100
|
||||||
|
|||||||
Reference in new issue
Block a user