Update StockIndex.py

yolo added vix idk if it works papa
This commit is contained in:
Kirk 2021-03-04 13:03:03 -08:00 committed by GitHub
parent d183172ca7
commit 0db7e23383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,12 @@ class StockIndex(ModuleBase):
@command("nasdaq", allow_private=True)
def cmd_nasdaq(self, message, command):
self.send_quote("^IXIC", "NASDAQ", message.replyto)
@info("vix", "get the current value of the vix/fear index", cmds=["vix"])
@command("vix", allow_private=True)
def cmd_vix(self, message, command):
self.send_quote("^vix", "VIX", message.replyto)
def send_quote(self, key, symbol, to):
index = self.cache[key]
is_gain = index["price"] >= index["previousClose"]