Beispiel #1
0
def load_google_returns(start_date=None,
                        end_date=None,
                        tickers=None,
                        data_name='Returns',
                        data_table=UK_STOCKS):
    if start_date is None and end_date is None:
        return tu.get_timeseries(DATABASE_NAME,
                                 data_table,
                                 column_list=tickers,
                                 data_name=data_name)
    else:
        return tu.get_timeseries(DATABASE_NAME,
                                 data_table,
                                 column_list=tickers,
                                 index_range=(start_date, end_date),
                                 data_name=data_name)
Beispiel #2
0
def load_financial_data(data_name='revenue',
                        tickers=None,
                        data_table=UK_FINANCIALS):
    return tu.get_timeseries(DATABASE_NAME,
                             data_table,
                             column_list=tickers,
                             data_name=data_name)
Beispiel #3
0
def get_cached_data(series_name, data_type, start_date=None, end_date=None):
    column = series_name + '|' + data_type
    ans = tu.get_timeseries(DATABASE_NAME, CACHE_TABLE_NAME, index_range=(start_date, end_date), column_list=[column])
    if ans is None:
        return None
    else:
        ans = ans.iloc[:, 0]
        ans.name = series_name
        return ans
Beispiel #4
0
def get_quandl_series(series_name, start_date=None, end_date=None):
    ans = tu.get_timeseries(DATABASE_NAME,
                            QUANDL_FUTURES,
                            index_range=(start_date, end_date),
                            column_list=['Settle'],
                            data_name=series_name)
    if ans is not None:
        ans = ans.iloc[:, 0]
        ans.name = series_name
        return ans
    else:
        return None
Beispiel #5
0
def get_trading_strategy_data(strategy_name):
    returns = tu.get_timeseries(DATABASE_NAME, STRATEGY_TABLE, column_list=['Asset Returns', 'Original Returns', 'Reversal Returns'], data_name=strategy_name)
    positions = tu.get_timeseries(DATABASE_NAME, STRATEGY_TABLE, column_list=['Original Positions', 'Reversal Positions'], data_name=strategy_name)
    signal = tu.get_timeseries(DATABASE_NAME, STRATEGY_TABLE, column_list=['Signal'], data_name=strategy_name)
    return dict(returns=returns, positions=positions, signal=signal)