Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Seeking help: Import securities from a list

I have a list which is a list of security symbols and corresponding number of shares.
I would like to import the securities to my universe from the list.

I am getting the following error
'Error: Arguments must be strings.'

at the line containing the code

'securities = symbols(raw_symbols,"2016-03-22")'.

Any help is appreciated. Thanks

#
context.basket = [['DHI',5966226], ['LEN',3340166], ['NVR',71491], ['PHM',6277596], ['TOL',3228812], ['HD',495609]]

tic_list = [row[0] for row in context.basket]  
code_string = "context.stocks = ["  
raw_symbols = str(tic_list)[1:-1]  #remove '[' and ']'

securities = symbols(raw_symbols,"2016-03-22")  
code_string += "symbol(" + str(security.symbol) + "), "  
code_string = code_string[:-2] + "]"  
print(code_string)