本文整理汇总了Python中pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs.convert_month_day_to_date_time方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeriesCalcs.convert_month_day_to_date_time方法的具体用法?Python TimeSeriesCalcs.convert_month_day_to_date_time怎么用?Python TimeSeriesCalcs.convert_month_day_to_date_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs
的用法示例。
在下文中一共展示了TimeSeriesCalcs.convert_month_day_to_date_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TimeSeriesRequest
# 需要导入模块: from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs [as 别名]
# 或者: from pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs import convert_month_day_to_date_time [as 别名]
###### calculate seasonal moves in EUR/USD and GBP/USD (using Quandl data)
if True:
time_series_request = TimeSeriesRequest(
start_date = "01 Jan 1970", # start date
finish_date = datetime.date.today(), # finish date
freq = 'daily', # daily data
data_source = 'quandl', # use Quandl as data source
tickers = ['EURUSD', # ticker (Thalesians)
'GBPUSD'],
fields = ['close'], # which fields to download
vendor_tickers = ['FRED/DEXUSEU', 'FRED/DEXUSUK'], # ticker (Quandl)
vendor_fields = ['close'], # which Bloomberg fields to download
cache_algo = 'internet_load_return') # how to return data
ltsf = LightTimeSeriesFactory()
df = ltsf.harvest_time_series(time_series_request)
df_ret = tsc.calculate_returns(df)
day_of_month_seasonality = seasonality.bus_day_of_month_seasonality(df_ret, partition_by_month = False)
day_of_month_seasonality = tsc.convert_month_day_to_date_time(day_of_month_seasonality)
gp = GraphProperties()
gp.date_formatter = '%b'
gp.title = 'FX spot moves by time of year'
gp.scale_factor = 3
gp.file_output = "output_data/20150724 FX spot seas.png"
pf.plot_line_graph(day_of_month_seasonality, adapter='pythalesians', gp = gp)