In the end I want to have a call function which loads the external data and this should called only once and not in every run. That's why the (count!=1) part.
Here's my simple plan:
1) load the external data
2) Store it in an array
3) run the time series and compare the dates
4) build an indicator for the whole time period
5) plot it

So, ist there a way to get no.3 done?

Can anyone explain, why I am losing one array entry per run?

Code
int count;
int cnt;
vars MySeriesArrayX; 
vars MySeriesArrayY;
function run()
{
	MySeriesArrayX=series(); 
	MySeriesArrayY=series(); 
	int date;
	int x;
	if (cnt<7){
		if (count!=1){
			if (!Init){
				
				for(x=0; x<5; x++) {
					MySeriesArrayX[x] = 20220101+x;
					MySeriesArrayY[x] = x+0.1;
				}	
				count=1;
			}
		}
		if(count==1){
			int i;
			for(i=0; i<5; i++){				
				date = MySeriesArrayX[i];
				printf("\n date: %d",date);
				printf("\n number: %f",MySeriesArrayY[i]);
			}
		}
		cnt++;
	}
}


Last edited by DisplayName; 03/23/23 11:31.