Really interesting problem. I developed a solution a few months ago for a similar problem that I think will be very useful here to create an intermediate 0/1 measure based on sign change that we can then use trigger reset of the cumulative total measure.
I’ll play around with this today, and hopefully have something back to you soon.