コード例 #1
0
def norgate_defined_start(watchlist, start_date, end_date, frequency):
    symbols = norgatedata.watchlist_symbols(watchlist)

    df_list = []

    for symbol in symbols:
        norgate_df = norgatedata.price_timeseries(symbol,
                                                  start_date=start_date,
                                                  end_date=end_date,
                                                  interval=frequency,
                                                  format='pandas-dataframe')

        # creating a symbol column so that we can identify
        # what ticker information we're looking at
        norgate_df['Symbol'] = symbol

        # appending the dataframes to an empty list to concatenate them after the for loop
        df_list.append(norgate_df)

    return df_list
import pandas as pd
import norgatedata
from datetime import datetime

lookback_period = 60
end_date = datetime.now()


watchlistname = 'spy_tlt_gld'
symbols = norgatedata.watchlist_symbols(watchlistname)

df_list = []

for symbol in symbols:

    norgate_df = norgatedata.price_timeseries(
        symbol,
        end_date=end_date,
        limit=lookback_period,
        interval='D',
        format='pandas-dataframe')

    # creating a symbol column so that we can identify
    # what ticker information we're looking at
    norgate_df['Symbol'] = symbol

    # appending the dataframes to an empty list to concatenate them after the for loop
    df_list.append(norgate_df)


# joins the dataframes together for all tickers
コード例 #3
0
ファイル: norgate_helper.py プロジェクト: waynewan/backtest
def load_index_universe(indexname):
	watchlist = watchlist_for(indexname)
	symbols = ng.watchlist_symbols(watchlist)
	return symbols
コード例 #4
0
ファイル: tib.py プロジェクト: zwocram/TFS
def get_symbols_from_norgate_watchlist(watchlist_name):
    symbols = norgatedata.watchlist_symbols(watchlist_name)

    return symbols