about series

Posted By: Grat

about series - 05/24/19 13:39

Hi,

Anybody know, where is mistake?
Code:
function run(){
	vars n;
	int i;
	if (is(INITRUN)){
	for (i=10;i<16;i++)
		n=series(i);
	
	for (i=0;i<5;i++)
		printf("n%f .. %d",n[i],i);
  
	}
	
}

and output is:


test compiling................
15.000000 .. 0
15.000000 .. 1
15.000000 .. 2
15.000000 .. 3
15.000000 .. 4
Test: test EUR/USD 2014..2019



I would expect in the variable "n" value from 10 to 15

Thanks Milan
Posted By: Grat

Re: about series - 05/24/19 13:49

with the dynamic series working:
Code:
function run(){
	//readActual();
	//loadVol();
	//TestActual();
	vars n=series(0,-5);
	int i;
	if (is(INITRUN)){
	for (i=10;i<16;i++)
		shift(n,i,5);
	
	for (i=0;i<5;i++)
		printf("n%f .. %d",n[i],i);
  
	}
}

output is:


test compiling................
15.000000 .. 0
14.000000 .. 1
13.000000 .. 2
12.000000 .. 3
11.000000 .. 4
Test: test EUR/USD 2014..2019



Question is: is a possible init series before start trading int the INITRUN?

Thanks
Posted By: Petra

Re: about series - 05/25/19 06:08

No because the manual says that series are created after the first run. I think in the initrun they have some dummy pointer.
© 2024 lite-C Forums