Problems with DRAW_ZIGZAG in MT4?

 

I have written an indicator which looks much like a zigzag, using the newer DRAW_ZIGZAG type instead of the older DRAW_HISTOGRAM.  

It works fine for a time, and then the buffers "bug out".  Here is a pic of what it looks like after it changes:

   https://www.mql5.com/en/charts/3890154/eurusd-m1-fx-choice-limited 

The yellow line is what the aqua should look like, and did, until it shifted and apparently refilled the buffers with out-of-range numbers.

Has anyone else seen this?  Is this a metatrader bug?

I cannot find rhyme or reason to it; sometimes it seems to happen after only a few bars, but usually it needs to be left for a matter of hours (it's shown on M1 chart).

Refreshing does not fix it; have to reset the ind so it can redo it's history.

Any clues on how to make it stop messing up  my buffers appreciated.  Been putting countless hours into fixing it and am at wits end....

Chart EURUSD, M1, 2015.09.02 10:07 UTC, FX Choice Limited, MetaTrader 4, Demo
Chart EURUSD, M1, 2015.09.02 10:07 UTC, FX Choice Limited, MetaTrader 4, Demo
  • www.mql5.com
Symbol: EURUSD. Periodicity: M1. Broker: FX Choice Limited. Trading Platform: MetaTrader 4. Trading Mode: Demo. Date: 2015.09.02 10:07 UTC.
Reason: