diff --git a/iqoptionapi/stable_api.py b/iqoptionapi/stable_api.py index 1ae24b6d..bdaf05f8 100644 --- a/iqoptionapi/stable_api.py +++ b/iqoptionapi/stable_api.py @@ -928,12 +928,16 @@ def buy_digital_spot(self, active, amount, action, duration): # And need to be on GMT time #Type - P or C - if action == 'put': - action = 'P' - elif action == 'call': - action = 'C' + if isinstance(action,string): + if action.lower() == 'put': + action = 'P' + elif action.lower() == 'call': + action = 'C' + else: + logging.error('buy_digital_spot active error') + return -1 else: - logging.error('buy_digital_spot active error') + logging.error('buy_digital_spot active error: need action as text') return -1 # doEURUSD201907191250PT5MPSPT timestamp = int(self.api.timesync.server_timestamp)