From f26a42e76f588d0ba0f2de8f72fbcd98d0c503ed Mon Sep 17 00:00:00 2001 From: Nelson Torres Date: Sun, 8 Dec 2024 10:51:17 -0300 Subject: [PATCH] datetime for humans --- max_pain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/max_pain.py b/max_pain.py index a2d1d64b..e8b0f933 100644 --- a/max_pain.py +++ b/max_pain.py @@ -4,6 +4,7 @@ from decimal import ( ) import trio import tractor +from datetime import datetime from pprint import pformat from piker.brokers.deribit.api import ( get_client, @@ -101,7 +102,7 @@ async def max_pain_daemon( if check_if_complete(oi_by_strikes): max_pain = get_max_pain(oi_by_strikes) print('-----------------------------------------------') - print(f'timestamp: {max_pain['timestamp']}') + print(f'timestamp: {datetime.fromtimestamp(max_pain['timestamp'])}') print(f'expiry_date: {max_pain['expiry_date']}') print(f'max_pain: {max_pain['max_pain']}') print(f'total intrinsic value: {max_pain['total_intrinsic_value']}')