modified create_moving_average_tick function to handle unfinished bars.