How do I get Swing date for the previous 2 points of a ZigZag?

 

Hi There,


Can you kindly assist me with how to obtain two previous ZigZag Swing Dates?

 
Find the last index that has a nonzero value, get the time of that index. repeat for the second.
Reason: