Hi guys, basic question, but id like to see a list of the stocks selected by dollaruniverse but the logger cuts it off how to get around this?
Hi guys, basic question, but id like to see a list of the stocks selected by dollaruniverse but the logger cuts it off how to get around this?
Use this code:
def initialize(context):
set_universe(universe.DollarVolumeUniverse(floor_percentile=98.0, ceiling_percentile=100.0))
context.other_stocks = symbols('CSCO', 'INTC') # add some specific securities
context.neverhaveiever = True
# Will be called on every trade event for the securities you specify.
def handle_data(context, data):
if context.neverhaveiever:
context.neverhaveiever = False
stock_list = []
for stock in data:
stock_list.append(str(stock.symbol)) # this will print out all the securities in the universe as well as CSCO and INTC
print stock_list
On the line 'print stock_list' set a debugger flag with stock_list != []. Then, in the debugger, do a print stock_list. As best I can tell, the debugger has no limits, by design.
Output from the debugger:
print stock_list
['YHOO', 'MU', 'AA', 'EOG', 'IVV', 'SSO', 'IWM', 'TZA', 'WMB', 'XOP', 'AAPL', 'SBUX', 'PXD', 'BHI', 'WMT', 'GOOG', 'VNQ', 'JNJ', 'ORCL', 'PM', 'XIV', 'CVX', 'GE', 'CHK', 'V', 'EWJ', 'GDXJ', 'OXY', 'TGT', 'MCD', 'CMCS_A', 'BABA', 'GPRO', 'UNH', 'F', 'XLV', 'MDY', 'SNDK', 'UNP', 'LYB', 'MON', 'DIA', 'EEM', 'FXI', 'TNA', 'GILD', 'DIS', 'IYR', 'MDT', 'QCOM', 'XOM', 'VRX', 'NFLX', 'USO', 'MPC', 'VXX', 'AXP', 'VOO', 'ABBV', 'IBM', 'GLD', 'MS', 'BA', 'KO', 'BAC', 'CVS', 'M', 'XLP', 'XLB', 'XLE', 'XLF', 'XLI', 'XLK', 'UTX', 'XLU', 'AGN', 'XLY', 'FDX', 'NKE', 'GS', 'VTI', 'DOW', 'HES', 'BP', 'AAL', 'BIIB', 'NOV', 'AIG', 'CAT', 'TWTR', 'PEP', 'LVS', 'REGN', 'SLB', 'CBS', 'PFE', 'PSX', 'TQQQ', 'PG', 'VLO', 'C', 'MMM', 'DVN', 'RIG', 'VZ', 'AMAT', 'MO', 'BRK_B', 'TWX', 'JNK', 'SPY', 'CSCO', 'TWC', 'INTC', 'AMGN', 'TLT', 'HAL', 'DXJ', 'HYG', 'ACT', 'CELG', 'OIH', 'GDX', 'HPQ', 'FCX', 'MA', 'UAL', 'KMI', 'WBA', 'PBR', 'TSLA', 'MRK', 'HD', 'LOW', 'MET', 'IBB', 'JPM', 'EBAY', 'FOXA', 'EFA', 'COP', 'APA', 'DAL', 'MSFT', 'FB', 'APC', 'AMZN', 'UPS', 'PCLN', 'QQQ', 'GOOG_L', 'BMY', 'EMC', 'WFC', 'DE', 'VWO', 'BIDU', 'LNKD', 'LUV', 'GM', 'EWZ', 'VALE', 'UVXY', 'TXN', 'T']