.
label as ‘hold’.The idea is to buy at troughs and sell at crests for any 11 day window.Here is the direct implementation of it: windowSize = 11 def labl(df = df, windowSize =11): labels = [] values = [] for i in range(len(df.close) - windowSize): mx= df.close[i] mn df.close[i] mxIndex, mnIndex = i,