custom indicator doesn't work right in past candle

 

i have a custom indicator that works fine with recent candle

but when i goes in the past in the chat(like over 2000 candle)

it start working wrong  but as soon i open input setting and closed it it works fine with past (but i go more in the past candle it have again this trouble)

the indicator using start function and have a 10000 candle count limit