You can write a simple algorithm to get a salary gesture. For your example, you need a time limit
public static int timeLimit = 5000;
Now think about the wave. It has 3 states
1) A neutral posture when your hand is in the same position along the X axis as your elbow.
2) When the arm is to the right of the elbow
3) When the arm is to the left of the elbow
Remember that you start from state 1. To get 2 to 3, you need to go from 1 in the middle. So, you see that there is a combination of 1 - 2 - 1 - 3 - 1 - the first wave
The resistance you can get from the position of the joint
first.Joints[JointType.HandRigh].Position.X
this is simple math.
About a second. Just select (for example) a SkeletonFrame timestamp and compare
if((currentTimestamp - startTimestamp) < MainWindom.timeLimit)
startTimestamp is a timestamp when your hand is able to start.
Also add a flag that indicates that the hand is on a good track.
I hope this helps
Fixus source share