Update api.py

covers cases when option_type comes as PUT or P, same with calls CALL or C
max_pain_deribit
Nelson Torres 2024-11-29 10:39:48 -03:00
parent 7b02df9b49
commit 4ccda643b8
1 changed files with 2 additions and 2 deletions

View File

@ -153,9 +153,9 @@ def piker_sym_to_cb_sym(name: str) -> Symbol:
new_expiry_date = get_timestamp_int(expiry_date) new_expiry_date = get_timestamp_int(expiry_date)
quote: str = base quote: str = base
if option_type == 'P': if option_type == 'P' or option_type == 'PUT':
option_type = PUT option_type = PUT
elif option_type == 'C': elif option_type == 'C' or option_type == 'CALL':
option_type = CALL option_type = CALL
else: else:
raise Exception("Couldn\'t parse option type") raise Exception("Couldn\'t parse option type")