Trendy
Trendy copied to clipboard
minitrend fixed
sorry for the way I do this, it is my first comment
only include this
x = x[window+1:] y = y[window+1:]
before
Find whether max's or min's
maxi = ((y[x[crit]] - y[x[crit] + window] > 0) & \
(y[x[crit]] - y[x[crit] - window] > 0) * 1)
mini = ((y[x[crit]] - y[x[crit] + window] < 0) & \
(y[x[crit]] - y[x[crit] - window] < 0) * 1)
maxi = maxi.astype(float)

Hi @lymadvisors
When running the minitrend, I get following error

Are you having the same problem? Even with the fix you described, I still get same error.
dy is first derivative of size window, crit includes second derivative always of size 1. Hence, you need to adjust crit parameter by:
crit = np.append(crit,[False]*(window+1))