programming problem

 


I want to update the ask value for all ticks  and reduce the spread by 50%, but the program only update 1 tick finally as shown by the print function.

Can anyone help me to fix the problem ?

void OnStart()

{
      MqlTick ticks[];
      if (CopyTicksRange(_Symbol,ticks,COPY_TICKS_ALL,0,TimeCurrent() * 1000))
      {
         for (int i = 0; i < ArraySize(ticks); i++)
         {
              ticks[i].ask = ticks[i].bid + ((ticks[i].ask - ticks[i].bid) * 0.5);
         }
         
         int count = CustomTicksReplace(_Symbol,0,TimeCurrent() * 1000,ticks,WHOLE_ARRAY);
         Print(count," ticks were updated.");
      
      }

}