Class based directional indicator
问题 I'm creating a class based directional indicator that given a number of days ( n_days ) and a list of numbers, it gives the (number of numbers out of the most recent n_days on which the number was higher than the previous number minus the n_days out of the previous n_days on which the number went down). So if the number in the list increases I want it to return +1 , if it decreases I want it to return -1 , otherwise it should be 0 so the first number should always be 0 since you can't compare