It's working for me so I don't know what happened.
I tried 48 bars/candlesticks and it's about right.
Thanks for your quick reply.
I am not a coder but I tried modifying and changed the number 250 to 999 as is shown in the picture.
Then, it works as I wish and of course no errors happened.