Could not figure out how to calculate new high after 30 days low. Please help me to change the commented line.
from quantopian.pipeline import CustomFactor
from numpy import nanmin, nanmax, nanargmin, nanargmax
class MultipleOutputs(CustomFactor):
inputs = [USEquityPricing.close]
outputs = ['highs', 'highs_idx', 'lows','lows_idx','highsAfterL']
window_length = 30
def compute(self, today, assets, out, close):
highs = nanmax(close, axis=0)
highs_idx = nanargmax(close, axis=0)
lows = nanmin(close, axis=0)
lows_idx=nanargmin(close, axis=0)
**#!!! Need help on calculate the high after the 30 days low
highsAfterL = nanmax(close[lows_idx:], axis=0)**
print(type(highs_idx[0]))
out.highs[:] = highs
out.highs_idx[:] = highs_idx
out.lows[:] = lows
out.lows_idx[:] = lows_idx
out.highsAfterL[:] = highsAfterL