My DLL on Metatrader 4 doesn't update with incoming ticks

 

I have written a simple DLL as part of a custom indicator for MetaTrader 4, which is called thus:

int start()
{
double Rates[][6];
int MaximumRecords = ArrayCopyRates( Rates, Symbol(), 0 ); 
  for( int zz = MaximumRecords; zz >= 0; zz-- ) { OutPut[zz] = EMPTY; }
     GetSMAArray( Rates, MaximumRecords, Periods, OutPut );
return(0); 
}

This works fine in that it plots as expected on the chart, but unfortunately it does not update with new, incoming ticks - it just plots on its initial call. What further code can I add to make the DLL update with incoming ticks? Almost all my searches have come up with variations on the use of

ExtCountedBars = IndicatorCounted();

to force a while loop to calculate, but these all apply to calculations contained in the .mq4 file itself. I want to force the DLL to recalculate. Secondly, I would like this recalculation to occur only on the completion of a bar and not on the arrival of all and every tick.