I can't help for zig-zag, because in my opinion this indicator is not to be used inside EA's... or I can'r understand it.
Fractals can be read for the 2'nd oldest candle (Candle ID=2). It sometimes puts and then clears it's arrow, so you can see "false" trades.
Fractals has two buffers - Up and Down. Each of them is 0 when there is no arrow, or above 0 when there is an arrow. If Up or Down is above 0, this situation remains until the end of the current candle, but as I mentioned above - sometimes Fractals changes it's decision and clears the arrow almost immediately.