Compare commits
No commits in common. "f9018670b96f61b7ce90d3d05ad39e5aefcb4af5" and "3b8cec45da1e84c2c48ff33e7c8cfce311fe7c9e" have entirely different histories.
f9018670b9
...
3b8cec45da
14
max_pain.py
14
max_pain.py
|
@ -10,20 +10,6 @@ async def max_pain_daemon(
|
||||||
) -> None:
|
) -> None:
|
||||||
async with maybe_open_oi_feed() as oi_feed:
|
async with maybe_open_oi_feed() as oi_feed:
|
||||||
print('Im in...')
|
print('Im in...')
|
||||||
def check_if_complete(
|
|
||||||
oi: dict[str, dict[str, Decimal | None]],
|
|
||||||
|
|
||||||
) -> bool:
|
|
||||||
for strike in oi:
|
|
||||||
if (
|
|
||||||
oi[strike]['C'] == None
|
|
||||||
or
|
|
||||||
oi[strike]['P'] == None
|
|
||||||
):
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|
|
@ -246,6 +246,20 @@ def get_config() -> dict[str, Any]:
|
||||||
|
|
||||||
return section
|
return section
|
||||||
|
|
||||||
|
def check_if_complete(
|
||||||
|
oi: dict[str, dict[str, Decimal | None]],
|
||||||
|
|
||||||
|
) -> bool:
|
||||||
|
for strike in oi:
|
||||||
|
if (
|
||||||
|
oi[strike]['C'] == None
|
||||||
|
or
|
||||||
|
oi[strike]['P'] == None
|
||||||
|
):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class Client:
|
class Client:
|
||||||
'''
|
'''
|
||||||
|
@ -872,7 +886,7 @@ async def aio_open_interest_feed_relay(
|
||||||
c: Decimal = Decimal(f'{close}')
|
c: Decimal = Decimal(f'{close}')
|
||||||
call_cash += max(0, (s - c) * oi_by_strikes[f'{close}']['C'])
|
call_cash += max(0, (s - c) * oi_by_strikes[f'{close}']['C'])
|
||||||
put_cash += max(0, (c - s) * oi_by_strikes[f'{close}']['P'])
|
put_cash += max(0, (c - s) * oi_by_strikes[f'{close}']['P'])
|
||||||
|
|
||||||
intrinsic_values[f'{strike}'] = {}
|
intrinsic_values[f'{strike}'] = {}
|
||||||
intrinsic_values[f'{strike}']['C'] = call_cash
|
intrinsic_values[f'{strike}']['C'] = call_cash
|
||||||
intrinsic_values[f'{strike}']['P'] = put_cash
|
intrinsic_values[f'{strike}']['P'] = put_cash
|
||||||
|
|
Loading…
Reference in New Issue