Exemplo n.º 1
0
def get_eod_for_ticker_for_date(start_date, end_date, ticker_id,
                                ticker_symbol):
    try:
        df = ek.get_timeseries(ticker_symbol,
                               fields='*',
                               start_date=start_date,
                               end_date=end_date,
                               interval='daily',
                               count=None,
                               calendar=None,
                               corax=None,
                               normalize=False,
                               raw_output=False,
                               debug=False)
        save_ticker_data(df, ticker_id)
    except Exception as e:
        log.Error(e)
Exemplo n.º 2
0
def thomson_timeseries(
    tickers,
    fields,
    corax,
    start_date=datetime.today().strftime("%Y%m%d"),
    end_date=datetime.today().strftime("%Y%m%d"),
):
    """ 톰슨 로이터 시계열 데이터 소싱 """
    ek.set_app_key("9c4370471d3c41ea9a2a8911d842812e941e06df")

    try:
        data = ek.get_timeseries(
            tickers,
            fields=fields,
            start_date=start_date,
            end_date=end_date,
            interval="daily",
            corax=corax,
        )
        print(data)
    except:
        raise ValueError("thomson data sourcing ERROR")
    return data