<s> import pandas <EOL> from qstkutil import DataAccess as da <EOL> import numpy as np <EOL> import math <EOL> import qstkutil . qsdateutil as du <EOL> import datetime as dt <EOL> import qstkutil . DataAccess as da <EOL> """<STR_LIT>""" <EOL> storename = "<STR_LIT>" <EOL> closefield = "<STR_LIT>" <EOL> volumefield = "<STR_LIT>" <EOL> window = <NUM_LIT:10> <EOL> def findEvents ( symbols , startday , endday , verbose = False ) : <EOL> timeofday = dt . timedelta ( hours = <NUM_LIT:16> ) <EOL> timestamps = du . getNYSEdays ( startday , endday , timeofday ) <EOL> dataobj = da . DataAccess ( '<STR_LIT>' ) <EOL> if verbose : <EOL> print __name__ + "<STR_LIT>" <EOL> close = dataobj . get_data ( timestamps , symbols , closefield ) <EOL> close = ( close . fillna ( ) ) . fillna ( method = '<STR_LIT>' ) <EOL> if verbose : <EOL> print __name__ + "<STR_LIT>" <EOL> for symbol in symbols : <EOL> close [ symbol ] [ close [ symbol ] >= <NUM_LIT:1.0> ] = np . NAN <EOL> for i in range ( <NUM_LIT:1> , len ( close [ symbol ] ) ) : <EOL> if np . isnan ( close [ symbol ] [ i - <NUM_LIT:1> ] ) and close [ symbol ] [ i ] < <NUM_LIT:1.0> : <EOL> close [ symbol ] [ i ] = <NUM_LIT:1.0> <EOL> close [ symbol ] [ close [ symbol ] < <NUM_LIT:1.0> ] = np . NAN <EOL> return close </s>
