Access other symbol's data which index is negative for the active symbol

Hello !
I have primary symbol that is quite limited in terms of data , let's say it is from 1jan2023 up to 1oct2023. And i have staticvar where data for another symbol is stored and this second symbol is from 1jan2000 up to today. Both series are intraday. How to access close of the previous day of second series from the first symbol ? I wrote this code -

spyf=StaticVarGet( "spyf");

dn = DateNum();

newDay = dn != Ref( dn,-1);
spyfD=spyf;

for( i = 0; i < BarCount; i++ )
	{
		if (i==0) {
???
		}
		if (i>0){ 
			if (newday[i]) {spyfD[i]=spyf[i-1];} else {spyfD[i]=spyfD[i-1];} }
	}

and everything is fine except of the first day. To get a close of previous day i have to access bar which index is negative for the primary series that is obviously impossible. ChatGPT gave a lot of options, none of them work.

Thank you.