update cron option job
This commit is contained in:
parent
a066c2164d
commit
ee6a0cae86
@ -176,13 +176,16 @@ async def get_single_contract_eod_data(symbol, contract_id, semaphore):
|
|||||||
try:
|
try:
|
||||||
volume = res_list[i]['volume']
|
volume = res_list[i]['volume']
|
||||||
avg_fill = res_list[i]['mark']
|
avg_fill = res_list[i]['mark']
|
||||||
|
res_list[i]['gex'] = res_list[i]['gamma'] * res_list[i]['open_interest'] * 100
|
||||||
|
res_list[i]['dex'] = res_list[i]['delta'] * res_list[i]['open_interest'] * 100
|
||||||
|
|
||||||
res_list[i]['total_premium'] = int(avg_fill*volume*100)
|
res_list[i]['total_premium'] = int(avg_fill*volume*100)
|
||||||
# Calculate the net premiums for call and put options
|
# Calculate the net premiums for call and put options
|
||||||
res_list[i]['net_premium'] = calculate_net_premium(res_list[i]['close_ask'], res_list[i]['close_bid'], res_list[i]['close_ask_size'], res_list[i]['close_bid_size'])
|
#res_list[i]['net_premium'] = calculate_net_premium(res_list[i]['close_ask'], res_list[i]['close_bid'], res_list[i]['close_ask_size'], res_list[i]['close_bid_size'])
|
||||||
|
|
||||||
except:
|
except:
|
||||||
res_list[i]['total_premium'] = 0
|
res_list[i]['total_premium'] = 0
|
||||||
res_list[i]['net_premium'] = 0
|
#res_list[i]['net_premium'] = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2675,7 +2675,6 @@ async def get_pre_post_quote(data:TickerData, api_key: str = Security(get_api_ke
|
|||||||
async def get_data(data:OptionContract, api_key: str = Security(get_api_key)):
|
async def get_data(data:OptionContract, api_key: str = Security(get_api_key)):
|
||||||
contract_id = data.contract
|
contract_id = data.contract
|
||||||
ticker = data.ticker
|
ticker = data.ticker
|
||||||
print(ticker, contract_id)
|
|
||||||
|
|
||||||
cache_key = f"options-contract-history-{ticker}-{contract_id}"
|
cache_key = f"options-contract-history-{ticker}-{contract_id}"
|
||||||
cached_result = redis_client.get(cache_key)
|
cached_result = redis_client.get(cache_key)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user