Please Explain Zig function

Please Explain the usage of Zig function.
Also Explain the following code. How it is working?

Sens=Param("Sens",4.75, 0.5, 15, 0.25);


BarTGH= BarsSince(Zig(C,Sens)==Trough(C,Sens));

I am new to afl programming and new to trading.
Please explain above code in details.

Google is your friend, use it.


Generally, Zig function looks into the future and can NOT be directly used in trading system UNLESS you wait for last leg to stabilize. Traders' Tips article shows how to do that