Correct transition directly from down to up trend

Reset duration when we go from up to down or vv