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