From bceecd857c627209f5c08c48a6271f43b25fdbcb Mon Sep 17 00:00:00 2001 From: Nelson Torres Date: Thu, 30 Jan 2025 02:36:17 +0000 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 301d1200..5b70bc98 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']}')