def __init__(self): self.logger = LoggerManager().getLogger(__name__) self._all_econ_tickers = pandas.read_csv(Constants().all_econ_tickers) self._econ_country_codes = pandas.read_csv( Constants().econ_country_codes) self._econ_country_groups = pandas.read_csv( Constants().econ_country_groups) self.time_series_factory = LightTimeSeriesFactory()
def __init__(self): super(StrategyTemplate, self).__init__() self.logger = LoggerManager().getLogger(__name__) ##### FILL IN WITH YOUR OWN PARAMETERS FOR display, dumping, TSF etc. self.tsfactory = LightTimeSeriesFactory() self.DUMP_CSV = 'output_data/' self.DUMP_PATH = 'output_data/' + datetime.date.today().strftime("%Y%m%d") + ' ' self.FINAL_STRATEGY = 'Thalesians FX CTA' self.SCALE_FACTOR = 3 return
data_source='bloomberg', # use Bloomberg as data source tickers=[ 'EURUSD', # ticker (Thalesians) 'GBPUSD', 'AUDUSD' ], fields=['close'], # which fields to download vendor_tickers=[ 'EURUSD BGN Curncy', # ticker (Bloomberg) 'GBPUSD BGN Curncy', 'AUDUSD BGN Curncy' ], vendor_fields=['PX_LAST'], # which Bloomberg fields to download cache_algo='internet_load_return') # how to return data ltsf = LightTimeSeriesFactory() df = None df = ltsf.harvest_time_series(time_series_request) tsc = TimeSeriesCalcs() df = tsc.calculate_returns(df) df = tsc.rolling_corr(df['EURUSD.close'], 20, data_frame2=df[['GBPUSD.close', 'AUDUSD.close']]) gp = GraphProperties() gp.title = "1M FX rolling correlations" gp.scale_factor = 3 pf = PlotFactory()