To calculate the basic statistics for positive and negative slope first, you need a trigger. In this case, we have to use two formulas to create a trigger. 


Trigger formula will convert the signal channel to pulses where the signal changes. You can achieve this by using edge function when the signal crosses 0 in a positive or negative direction.





To get one channel in basic statistics which will calculate positive and negative slope, use the triggered blocks and Trigger channel for the trigger.


The basic statistics outputs the value at the end of each block.