Beispiel #1
0
    def __init__(self, data: dataBlob = arg_not_supplied):
        # Check data has the right elements to do this
        if data is arg_not_supplied:
            data = dataBlob()

        data.add_class_object(arcticFxPricesData)
        self.data = data
Beispiel #2
0
def update_historical_prices_for_instrument(
        instrument_code: str,
        data: dataBlob,
        cleaning_config: priceFilterConfig = arg_not_supplied,
        interactive_mode: bool = False):
    """
    Do a daily update for futures contract prices, using IB historical data

    :param instrument_code: str
    :param data: dataBlob
    :return: None
    """
    diag_contracts = dataContracts(data)
    all_contracts_list = diag_contracts.get_all_contract_objects_for_instrument_code(
        instrument_code)
    contract_list = all_contracts_list.currently_sampling()

    if len(contract_list) == 0:
        data.log.warn("No contracts marked for sampling for %s" %
                      instrument_code)
        return failure

    for contract_object in contract_list:
        data.update_log(contract_object.specific_log(data.log))
        update_historical_prices_for_instrument_and_contract(
            contract_object,
            data,
            cleaning_config=cleaning_config,
            interactive_mode=interactive_mode)

    return success
Beispiel #3
0
    def __init__(self, data: dataBlob = arg_not_supplied):
        # Check data has the right elements to do this
        if data is arg_not_supplied:
            data = dataBlob()

        data.add_class_list([
            arcticFuturesContractPriceData, arcticFuturesAdjustedPricesData,
            arcticFuturesMultiplePricesData, mongoFuturesContractData
        ])
        self.data = data
Beispiel #4
0
 def __init__(self, data: dataBlob = arg_not_supplied):
     # Check data has the right elements to do this
     if data is arg_not_supplied:
         data = dataBlob()
     data.add_class_list([
         mongoInstrumentOrderStackData, mongoContractOrderStackData,
         mongoBrokerOrderStackData, mongoContractHistoricOrdersData,
         mongoStrategyHistoricOrdersData, mongoBrokerHistoricOrdersData
     ])
     self._data = data
def strategy_weights_if_none_passed(data: dataBlob) -> dict:
    list_of_strategies = get_list_of_strategies_from_config(data)
    count_of_strateges = len(list_of_strategies)
    weight = 100.0 / count_of_strateges
    data.log(
        "No configuration for strategy weight defined in private config; equally weighting across %s each gets %f percent"
        % (str(list_of_strategies), weight))
    output_dict = dict([(strat_name, weight)
                        for strat_name in list_of_strategies])

    return output_dict
Beispiel #6
0
    def __init__(self, data: dataBlob = arg_not_supplied):
        # Check data has the right elements to do this
        if data is arg_not_supplied:
            data = dataBlob()

        data.add_class_list([
            ibFxPricesData, ibFuturesContractPriceData, ibFuturesContractData,
            ibContractPositionData, ibOrdersData, ibMiscData, ibCapitalData,
            ibFuturesInstrumentData
        ])

        self._data = data
Beispiel #7
0
 def _add_required_classes_to_data(self, data: dataBlob) -> dataBlob:
     data.add_class_list([mongoPositionLimitData,
                           mongoTemporaryCloseData])
     return data
 def _add_required_classes_to_data(self, data: dataBlob) -> dataBlob:
     data.add_class_object(arcticFxPricesData)
     return data