Exemplo n.º 1
0
 def __init__(self,
              mongo_db=arg_not_supplied,
              log=logtoscreen("mongoRollParametersData")):
     super().__init__(log=log)
     self._mongo_data = mongoDataWithSingleKey(ROLL_COLLECTION,
                                               "instrument_code",
                                               mongo_db=mongo_db)
    def __init__(self, mongo_db=None, log=logtoscreen("mongoRollStateData")):

        super().__init__(log=log)

        self._mongo_data = mongoDataWithSingleKey(ROLL_STATUS_COLLECTION,
                                                  ROLL_KEY,
                                                  mongo_db=mongo_db)
Exemplo n.º 3
0
 def __init__(self,
              mongo_db=arg_not_supplied,
              log=logtoscreen("mongoLogData")):
     self._mongo_data = mongoDataWithSingleKey(LOG_COLLECTION_NAME,
                                               LOG_RECORD_ID,
                                               mongo_db=mongo_db)
     super().__init__(log=log)
Exemplo n.º 4
0
    def __init__(self,
                 mongo_db=arg_not_supplied,
                 log=logtoscreen("mongotemporaryCloseData")):

        super().__init__(log=log)
        self._mongo_data = mongoDataWithSingleKey(TEMPORARY_CLOSE_COLLECTION,
                                                  "instrument_code",
                                                  mongo_db=mongo_db)
    def __init__(
            self,
            mongo_db=arg_not_supplied,
            log=logtoscreen("mongoControlProcessData")):

        super().__init__(log=log)

        self._mongo_data = mongoDataWithSingleKey(PROCESS_CONTROL_COLLECTION, PROCESS_CONTROL_KEY, mongo_db=mongo_db)
Exemplo n.º 6
0
    def __init__(self,
                 mongo_db=arg_not_supplied,
                 log=logtoscreen("mongoFuturesInstrumentData")):

        super().__init__(log=log)
        self._mongo_data = mongoDataWithSingleKey(INSTRUMENT_COLLECTION,
                                                  "instrument_code",
                                                  mongo_db=mongo_db)
Exemplo n.º 7
0
    def __init__(self,
                 mongo_db=arg_not_supplied,
                 log=logtoscreen("mongoLockData")):

        super().__init__(log=log)
        self._mongo_data = mongoDataWithSingleKey(LOCK_STATUS_COLLECTION,
                                                  "instrument_code",
                                                  mongo_db=mongo_db)
Exemplo n.º 8
0
    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__()
        collection_name = self._collection_name()
        self._mongo_data = mongoDataWithSingleKey(collection_name, "order_id", mongo_db=mongo_db)

        super().__init__(log=log)
Exemplo n.º 9
0
 def __init__(self,
              mongo_db: mongoDb = arg_not_supplied,
              log=logtoscreen("mongoLogData")):
     self._mongo_data = mongoDataWithSingleKey(
         collection_name=LOG_COLLECTION_NAME,
         key_name=LOG_RECORD_ID,
         mongo_db=mongo_db,
     )
     super().__init__(log=log)
    def __init__(self,
                 mongo_db=arg_not_supplied,
                 log=logtoscreen("mongoFuturesContractData")):

        super().__init__(log=log)
        mongo_data = mongoDataWithSingleKey(CONTRACT_COLLECTION,
                                            "contract_key",
                                            mongo_db=mongo_db)
        self._mongo_data = mongo_data
Exemplo n.º 11
0
    def __init__(
            self,
            mongo_db=arg_not_supplied,
            log=logtoscreen("mongoMarginData"),
    ):

        self._mongo_data = mongoDataWithSingleKey(MARGIN_COLLECTION,
                                                  STRATEGY_REF, mongo_db)
        self._log = log
Exemplo n.º 12
0
    def __init__(
        self,
        mongo_db=arg_not_supplied,
        idoffset=arg_not_supplied,
        log=logtoscreen("mongoIDTracker"),
    ):

        super().__init__(log=log, idoffset=idoffset)
        self._mongo_data = mongoDataWithSingleKey(IB_CLIENT_COLLECTION, IB_ID_REF, mongo_db)
Exemplo n.º 13
0
 def __init__(
     self,
     type: str,
     data=None,
     log_level: str="Off",
     mongo_db: mongoDb=arg_not_supplied,
     **kwargs,
 ):
     super().__init__(type=type, data = data, log_level=log_level, **kwargs)
     self._mongo_data = mongoDataWithSingleKey(LOG_COLLECTION_NAME, LOG_RECORD_ID, mongo_db=mongo_db)
    def __init__(self,
                 mongo_db=arg_not_supplied,
                 log=logtoscreen("mongoFuturesContractData")):

        super().__init__(log=log)
        mongo_data = mongoDataWithSingleKey(CONTRACT_COLLECTION,
                                            "contract_key",
                                            mongo_db=mongo_db)
        self._mongo_data = mongo_data

        any_old_data_was_modified = _from_old_to_new_contract_storage(
            mongo_data)
        if any_old_data_was_modified:
            self.log.critical(
                "Modified the storage of contract data. Any other processes running will need restarting with new code"
            )