def __init__(self, type, mongo_db=None, log_level="Off", **kwargs): self._mongo = mongoConnection(LOG_COLLECTION_NAME, mongo_db=mongo_db) super().__init__(type=type, log_level=log_level, **kwargs) # this won't create the index if it already exists self._mongo.create_multikey_index(LOG_RECORD_ID, LEVEL_ID)
def __init__( self, mongo_db=arg_not_supplied, idoffset=arg_not_supplied, log=logtoscreen("mongoIDTracker"), ): if mongo_db is arg_not_supplied: mongo_db = mongoDb() if idoffset is arg_not_supplied: _notused_ipaddress, _notused_port, idoffset = ib_defaults() self._mongo = mongoConnection(IB_CLIENT_COLLECTION, mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_index("client_id") self.name = "Tracking IB client IDs, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port, ) self.log = log self._idoffset = idoffset
def __init__(self, mongo_db = None, thing="", log_level="Off", **kwargs): self._mongo = mongoConnection(LOG_COLLECTION_NAME, mongo_db=mongo_db) super().__init__(thing = thing, log_level = log_level, ** kwargs) # this won't create the index if it already exists self._mongo.create_multikey_index(TIMESTAMP_ID, LEVEL_ID)
def init_mongo( self, collection_name: str, mongo_db=arg_not_supplied, ): mongo_object = mongoConnection(collection_name, mongo_db=mongo_db) self._mongo = mongo_object
def __init__(self, mongo_db=None, log=logtoscreen("mongoOverrideData")): super().__init__(log=log) self._mongo = mongoConnection(OVERRIDE_STATUS_COLLECTION, mongo_db=mongo_db) self.name = "Data connection for override data, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db=None, log=logtoscreen("mongoLockData")): super().__init__(log=log) self._mongo = mongoConnection(LOCK_STATUS_COLLECTION, mongo_db=mongo_db) self._mongo.create_index("instrument_code") self.name = "Data connection for lock data, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db=None, log=logtoscreen("mongoTradeLimitData")): super().__init__(log=log) self._mongo = mongoConnection(LIMIT_STATUS_COLLECTION, mongo_db=mongo_db) self.name = "Data connection for trade limit data, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db = None, log=logtoscreen("mongoCapitalData")): super().__init__(log=log) self._mongo = mongoConnection(self._collection_name(), mongo_db=mongo_db) # this won't create the index if it already exists self.name = "Data connection for %s, mongodb %s/%s @ %s -p %s " % (self._data_name(), self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db=None, log=logtoscreen("mongoOrderStackData")): # Not needed as we don't store anything in _state attribute used in parent class # If we did have _state would risk breaking if we forgot to override methods #super().__init__() self._mongo = mongoConnection(self._collection_name(), mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_index("key")
def __init__(self, mongo_db=None, log=logtoscreen("mongoEmailControlData")): self._mongo = mongoConnection(EMAIL_CONTROL_COLLECTION, mongo_db=mongo_db) self.name = "simData connection for email control, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port) self.log = log
def __init__(self, mongo_db = None, log=logtoscreen("mongoFuturesContractData")): super().__init__(log=log) self._mongo = mongoConnection(CONTRACT_COLLECTION, mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_multikey_index("instrument_code", "contract_date") self.name = "simData connection for futures contracts, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db=None, log=logtoscreen()): super().__init__(log=log) self._mongo = mongoConnection(INSTRUMENT_COLLECTION, mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_index("instrument_code") self.name = "simData connection for futures instruments, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, database_name= DEFAULT_DB): super().__init__() self._mongo = mongoConnection(database_name, CONTRACT_COLLECTION) # this won't create the index if it already exists self._mongo.create_multikey_index("instrument_code", "contract_date") self.name = "simData connection for futures contracts, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__( self, type, data=None, log_level="Off", mongo_db=None, **kwargs, ): super().__init__(type=type, log_level=log_level, **kwargs) self._mongo = mongoConnection(LOG_COLLECTION_NAME, mongo_db=mongo_db) self.data = data
def __init__(self, mongo_db = None, log=logtoscreen("mongoRollStateData")): super().__init__(log=log) self._mongo = mongoConnection(ROLL_STATUS_COLLECTION, mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_index("instrument_code") self.name = "Data connection for futures roll state, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, database_name = DEFAULT_DB): super().__init__() self._mongo = mongoConnection(database_name, ROLL_COLLECTION) # this won't create the index if it already exists self._mongo.create_index("instrument_code") self.name = "Data connection for futures roll parameters, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, database_name=DEFAULT_DB): super().__init__() self._mongo = mongoConnection(database_name, CONTRACT_COLLECTION) # this won't create the index if it already exists self._mongo.create_multikey_index("instrument_code", "contract_date") self.name = "Data connection for futures contracts, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def init_mongo(self, collection_name: str, key_name: str, mongo_db =arg_not_supplied,): mongo_object = mongoConnection(collection_name, mongo_db=mongo_db) self._mongo = mongo_object self._key_name = key_name # this won't create the index if it already exists # if a different index exists (FIX ME WILL HAPPEN UNTIL NEW DATA READY)... try: self._mongo.create_index(self.key_name) except: pass
def init_mongo( self, collection_name: str, key_name: str, mongo_db=None, ): mongo_object = mongoConnection(collection_name, mongo_db=mongo_db) self._mongo = mongo_object self._collection_name = collection_name self._key_name = key_name # this won't create the index if it already exists self._mongo.create_index(self.key_name)
def __init__(self, mongo_db=None, log=logtoscreen("mongoControlProcessData")): super().__init__(log=log) self._mongo = mongoConnection(PROCESS_CONTROL_COLLECTION, mongo_db=mongo_db) # this won't create the index if it already exists self._mongo.create_index("process_name") self.name = "Data connection for process control, mongodb %s/%s @ %s -p %s " % ( self._mongo.database_name, self._mongo.collection_name, self._mongo.host, self._mongo.port)
def __init__(self, mongo_db=None): self._mongo = mongoConnection(LOG_COLLECTION_NAME, mongo_db=mongo_db)
def __init__(self, mongo_db=None, log=logToMongod("mongoLogData")): self._mongo = mongoConnection(LOG_COLLECTION_NAME, mongo_db=mongo_db)