INNER CODE UNIT · Python
process_date
AlexShakaev/backtesting_and_algotrading_options_with_Interactive_Brokers_API · utils/spy_client.py:32
def process_date(date_string):
''' Converts date string to np.datetime64 format'''
date_string = (date_string.split()[0] + ' ' + date_string.split()[1])
date_string = pd.to_datetime(date_string)
return date_string
class Client(EWrapper, EClient):
''' Serves as the client and the wrapper '''
def __init__(self, addr, port, client_id):
EWrapper.__init__(self)
EClient.__init__(self, self)
self.funds = 0.0
self.index = 0
self.entered = False
self.signal = False
self.current_price = 0.0
self.filled = False