How to allow a zigzag have both peak & trough on the very same bar'?

Hello everyone.

Does anyone knows any possible way, to let a zigzag have both peak & trough on the very same bar'?

Any zigzag which uses following conditions (or any other conditions) as its base to create peak & troughs:

Resistance = HHV( High, 1 );
Support = LLV( Low, 1 );

CrossUp = High > Ref( Resistance, -1 );
CrossDown = Low < Ref( Support, -1 );

CrossUp = ExRem( CrossUp, CrossDown );
CrossDown = ExRem( CrossDown, CrossUp );

UpTrend = Flip( CrossUp, CrossDown );
DownTrend = Flip( CrossDown, CrossUp );