What is the best way available in quant connect to check a position's age?

I'm working on a script that close an asset position after x days. The problem is that if the algorithm stops, I loose this information when the algorythm is redeployed as variables get reinitialized. It's clear to me how to writevte code to check if my portfolio has an active position, but how can I check for how long this position has been active?