#NEWLINE# def initialize( algo , eps = 1 , window_length = 5 ) : #NEWLINE# #INDENT# algo . stocks = STOCKS #NEWLINE# algo . sids = [ algo . symbol ( symbol ) for symbol in algo . stocks ] #NEWLINE# algo . m = len ( algo . stocks ) #NEWLINE# algo . price = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# algo . b_t = ( np . ones ( algo . m ) / algo . m ) #NEWLINE# algo . last_desired_port = ( np . ones ( algo . m ) / algo . m ) #NEWLINE# algo . eps = eps #NEWLINE# algo . init = True #NEWLINE# algo . days = 0 #NEWLINE# algo . window_length = algo #NEWLINE# algo . set_commission ( commission . PerShare ( cost = 0 ) )