There is a way in MQL4 Indicators :
As documented, there is a special value == EMPTY_VALUE
to serve exactly this purpose.
The EMPTY_VALUE
constant usually corresponds to the values of indicators that are not shown in the chart.
Just assign, where plausible in your indicator code - either per-bar in assignment BreakOutBUFFER[i] = ( isHereBreakOut( i ) ) ? aLevel : EMPTY_VALUE;
or
by a pre-initialised ArrayInitialize( BreakOutBUFFER, EMPTY_VALUE );
and re-assigning only those cells, where your BreakOut-logic is POSACK'd, yet this is not a preferred way, as the first sooner-or-later coming ( automatic or not ) ArrayResize()
will extend this Buffer, as documented:
... the elements will be added at the end of the array, their values will be undefined and in most cases will not be equal to init_value.
but .... not with the pre-set EMPTY_VALUE
initialiser...
My option is, obviously, to go the former way