Beispiel #1
0
    def add_rows_to_existing_data(
        self, new_futures_per_contract_prices, check_for_spike=True
    ):
        """
        Merges self with new data.
        Only newer data will be added

        :param new_futures_per_contract_prices: another futures per contract prices object

        :return: merged futures_per_contract object
        """

        merged_futures_prices = merge_newer_data(
            pd.DataFrame(self),
            new_futures_per_contract_prices,
            check_for_spike=check_for_spike,
            column_to_check=FINAL_COLUMN,
        )

        if merged_futures_prices is spike_in_data:
            return spike_in_data

        merged_futures_prices = futuresContractPrices(merged_futures_prices)

        return merged_futures_prices
    def add_rows_to_existing_data(self, new_fx_prices, check_for_spike=True):
        """
        Merges self with new data.
        Only newer data will be added

        :param new_fx_prices:

        :return: merged fxPrices
        """

        merged_fx_prices = merge_newer_data(self,
                                            new_fx_prices,
                                            check_for_spike=check_for_spike)
        if merged_fx_prices is spike_in_data:
            return spike_in_data

        merged_fx_prices = fxPrices(merged_fx_prices)

        return merged_fx_prices