Update database_caller.py
This commit is contained in:
parent
f569f9ed1e
commit
62e30970de
@ -147,6 +147,11 @@ def updateStocksPrePost(api_key, logf):
|
|||||||
stock_info[stock['symbol']]['Pre-market'] = {'preprice': '%.2f' % stock['preMarketPrice'],
|
stock_info[stock['symbol']]['Pre-market'] = {'preprice': '%.2f' % stock['preMarketPrice'],
|
||||||
'prechange': '%.2f' % stock['preMarketChange'],
|
'prechange': '%.2f' % stock['preMarketChange'],
|
||||||
'prepercent': '%.2f' % stock['preMarketChangePercent']}
|
'prepercent': '%.2f' % stock['preMarketChangePercent']}
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
stock_info[stock['symbol']]['Pre-market'] = {'preprice': '%.2f' % stock['postMarketPrice'],
|
||||||
|
'prechange': '%.2f' % 0,
|
||||||
|
'prepercent': '%.2f' % 0}
|
||||||
except:
|
except:
|
||||||
stock_info[stock['symbol']]['Pre-market'] = {'preprice': '%.2f' % stock['regularMarketPrice'],
|
stock_info[stock['symbol']]['Pre-market'] = {'preprice': '%.2f' % stock['regularMarketPrice'],
|
||||||
'prechange': '%.2f' % 0,
|
'prechange': '%.2f' % 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user