This looks ok, but don't forget to free the memory at the end of the script. series(0) is not the same, since a series is shifted at any bar and has only the length given by LookBack.