#NEWLINE# def getTSFromData( dataname , partname , symbols , tsstart , tsend ) : #NEWLINE# #INDENT# pathpre = ( os . environ . get ( 'QSDATA' ) + '/Processed' ) #NEWLINE# if ( dataname == 'Norgate' ) : #NEWLINE# #INDENT# pathsub = '/Norgate/Equities' #NEWLINE# paths = list ( ) #NEWLINE# paths . append ( ( ( pathpre + pathsub ) + '/US_NASDAQ/' ) ) #NEWLINE# paths . append ( ( ( pathpre + pathsub ) + '/US_NYSE/' ) ) #NEWLINE# paths . append ( ( ( pathpre + pathsub ) + '/US_NYSE Arca/' ) ) #NEWLINE# paths . append ( ( ( pathpre + pathsub ) + '/OTC/' ) ) #NEWLINE# datastr1 = '/StrategyData' #NEWLINE# datastr2 = 'StrategyData' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'unknown dataname ' + str ( dataname ) ) ) #NEWLINE# #UNINDENT# data = da . DataAccess ( True , paths , datastr1 , datastr2 , False , symbols , tsstart , tsend ) #NEWLINE# tss = list ( data . getTimestampArray ( ) ) #NEWLINE# start_time = tss [ 0 ] #NEWLINE# end_time = tss [ ( - 1 ) ] #NEWLINE# vals = data . getMatrixBetweenTS ( symbols , partname , start_time , end_time ) #NEWLINE# syms = list ( data . getListOfSymbols ( ) ) #NEWLINE# del data #NEWLINE# return TimeSeries ( tss , syms , vals )