decide Buy or Sell with ZigZag

 
Hi all
I want to make an expert advisor that uses ZigZag to decide when it should buy or sell and I want to use iCustom to access the Zigzag values. Can anyone shows a simple example about it and a little explanes about it.
Thanks
Reason: