Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -86,6 +86,7 @@ class StockDataFetcher:
|
|
86 |
response = requests.get(self.option_chain + symbol, headers=self.headers)
|
87 |
data = response.json()['optionChain']['optionChains']
|
88 |
ltp = response.json()['livePrice']['value']
|
|
|
89 |
|
90 |
chain = []
|
91 |
for i in range(len(data)):
|
@@ -97,7 +98,7 @@ class StockDataFetcher:
|
|
97 |
print(response.json()['livePrice'])
|
98 |
chain = chain[index-6:index+7].reset_index(drop=True)
|
99 |
optin_exp = chain['Symbol_CE'][0][:-7]
|
100 |
-
return chain, optin_exp
|
101 |
|
102 |
def search_entity(self, symbol, entity=None, page=0, size=1, app=False):
|
103 |
params = {
|
|
|
86 |
response = requests.get(self.option_chain + symbol, headers=self.headers)
|
87 |
data = response.json()['optionChain']['optionChains']
|
88 |
ltp = response.json()['livePrice']['value']
|
89 |
+
index_ltp = requests.get(self.latest_index_price + symbol.upper() + "/latest", headers=self.headers).json()['value']
|
90 |
|
91 |
chain = []
|
92 |
for i in range(len(data)):
|
|
|
98 |
print(response.json()['livePrice'])
|
99 |
chain = chain[index-6:index+7].reset_index(drop=True)
|
100 |
optin_exp = chain['Symbol_CE'][0][:-7]
|
101 |
+
return chain, optin_exp, index_ltp
|
102 |
|
103 |
def search_entity(self, symbol, entity=None, page=0, size=1, app=False):
|
104 |
params = {
|