def _get_adj_prices_data_object(self): pathname =self._resolve_path("adjusted_prices") adj_prices_data = csvFuturesAdjustedPricesData(pathname) adj_prices_data.log = self.log return adj_prices_data
def _get_adj_prices_data_object(self): pathname = self._resolve_path("adjusted_prices") adj_prices_data = csvFuturesAdjustedPricesData(pathname) adj_prices_data.log = self.log return adj_prices_data
def init_arctic_with_csv_futures_contract_prices(): csv_multiple_prices = csvFuturesMultiplePricesData() csv_adj_prices = csvFuturesAdjustedPricesData() input("WARNING THIS WILL ERASE ANY EXISTING ARCTIC PRICES WITH DATA FROM %s,%s ARE YOU SURE?!" % (csv_adj_prices.datapath, csv_multiple_prices.datapath)) instrument_codes = csv_multiple_prices.get_list_of_instruments() for instrument_code in instrument_codes: init_arctic_with_csv_prices_for_code(instrument_code)
def init_arctic_with_csv_prices_for_code(instrument_code:str): print(instrument_code) csv_mult = csvFuturesMultiplePricesData() a_mult = arcticFuturesMultiplePricesData() mult = csv_mult.get_multiple_prices(instrument_code) a_mult.add_multiple_prices(instrument_code, mult, ignore_duplication=True) csv_adj = csvFuturesAdjustedPricesData() a_adj = arcticFuturesAdjustedPricesData() adj = csv_adj.get_adjusted_prices(instrument_code) a_adj.add_adjusted_prices(instrument_code, adj, ignore_duplication=True)
def init_arctic_with_csv_futures_contract_prices( multiple_price_datapath=arg_not_supplied, adj_price_datapath=arg_not_supplied): csv_multiple_prices = csvFuturesMultiplePricesData(multiple_price_datapath) csv_adj_prices = csvFuturesAdjustedPricesData(adj_price_datapath) input( "WARNING THIS WILL ERASE ANY EXISTING ARCTIC PRICES WITH DATA FROM %s,%s ARE YOU SURE?! CTRL-C TO ABORT" % (csv_adj_prices.datapath, csv_multiple_prices.datapath)) instrument_codes = csv_multiple_prices.get_list_of_instruments() for instrument_code in instrument_codes: init_arctic_with_csv_prices_for_code( instrument_code, multiple_price_datapath=multiple_price_datapath, adj_price_datapath=adj_price_datapath)
def init_arctic_with_csv_prices_for_code( instrument_code: str, multiple_price_datapath=arg_not_supplied, adj_price_datapath=arg_not_supplied, ): print(instrument_code) csv_mult_data = csvFuturesMultiplePricesData(multiple_price_datapath) arctic_mult_data = arcticFuturesMultiplePricesData() mult_prices = csv_mult_data.get_multiple_prices(instrument_code) arctic_mult_data.add_multiple_prices(instrument_code, mult_prices, ignore_duplication=True) csv_adj_data = csvFuturesAdjustedPricesData(adj_price_datapath) arctic_adj_data = arcticFuturesAdjustedPricesData() adj_prices = csv_adj_data.get_adjusted_prices(instrument_code) arctic_adj_data.add_adjusted_prices(instrument_code, adj_prices, ignore_duplication=True)
""" Copy from csv repo files to arctic for adjusted prices """ from sysdata.arctic.arctic_adjusted_prices import arcticFuturesAdjustedPricesData from sysdata.csv.csv_adjusted_prices import csvFuturesAdjustedPricesData if __name__ == "__main__": artic_adjusted_prices = arcticFuturesAdjustedPricesData() csv_adjusted_prices = csvFuturesAdjustedPricesData() instrument_list = csv_adjusted_prices.get_list_of_instruments() for instrument_code in instrument_list: print(instrument_code) adjusted_prices = csv_adjusted_prices.get_adjusted_prices( instrument_code) print(adjusted_prices) artic_adjusted_prices.add_adjusted_prices( instrument_code, adjusted_prices, ignore_duplication=True )
def _get_data_inputs(csv_adj_data_path): arctic_multiple_prices = arcticFuturesMultiplePricesData() arctic_adjusted_prices = arcticFuturesAdjustedPricesData() csv_adjusted_prices = csvFuturesAdjustedPricesData(csv_adj_data_path) return arctic_multiple_prices, arctic_adjusted_prices, csv_adjusted_prices
""" Copy from csv repo files to arctic for adjusted prices """ from syscore.objects import arg_not_supplied from sysdata.arctic.arctic_adjusted_prices import arcticFuturesAdjustedPricesData from sysdata.csv.csv_adjusted_prices import csvFuturesAdjustedPricesData if __name__ == "__main__": input("Will overwrite existing prices are you sure?! CTL-C to abort") artic_adjusted_prices = arcticFuturesAdjustedPricesData() ## MODIFY PATH TO USE SOMETHING OTHER THAN DEFAULT csv_adj_datapath = arg_not_supplied csv_adjusted_prices = csvFuturesAdjustedPricesData(csv_adj_datapath) instrument_list = csv_adjusted_prices.get_list_of_instruments() for instrument_code in instrument_list: print(instrument_code) adjusted_prices = csv_adjusted_prices.get_adjusted_prices( instrument_code) print(adjusted_prices) artic_adjusted_prices.add_adjusted_prices(instrument_code, adjusted_prices, ignore_duplication=True)