Hi Igor, a while back you created this script for me. I wanted to do a tweak to it. I want to buy or sell on the new bar the moment the zig line extends to current closed bar. If you watch the chart in real time or playback, you'll see that that the zig line will extend to current bar when it closes. Sometimes that will be the true peak or trough, other times not if the price continues to move. But regardless it should mark buy or sell the first time it extends to current bar and then wait for opposite signal.