Detecting peak value on realtime IMU data stream
In order to detect peaks, the simplest method will be to take the difference of adjacent samples and check for zero crossing. You may also want to smooth out the data before taking difference to prevent spurious peaks due to noise. An outline of the procedure here would be like this


Smooth out the data using Moving average filtering. It is a simple filtering where you take average of, say, 5 neighboring samples to arrive at sample value.
For the above filtered signal take the adjacent sample difference ($y[n] = x[n] - x[n-1]) and save the sample indices where difference hits zero (or near zero).
To differentiate positive peaks from negative peaks, also check for sign of sample values around these indices. Eliminate negative peaks, and remaining ones indicate positions where positive peaks occur. 
You may not get exact zero crossing, so you may want to keep a threshold. Also, the position may have offset due to filter delay. A 5-sample MA filter will delay your sample train by ceil(5)=3 samples.
There are ways to combine MA filtering and taking difference. Look for filters which do differentiation (https://www.dsprelated.com/showarticle/35.php)