Beginner question : vars and series

Posted By: jc45

Beginner question : vars and series - 07/15/16 15:11

Hello everybody,
I'm a beginner and I'm in trouble with this simple code :

function run()
{
BarPeriod = 1440;
set(PRELOAD);
LookBack = 250;

asset("vxmt");
vars priceVXMT = series(priceClose());
asset("vxv");
vars priceVXV = series(priceClose());

vars ratio = series(priceVXV/priceVXMT);
vars ratioSMA = series(SMA(ratio,20));

}

error in line 16:
Syntax error : wrong type DIV:POINTER:POINTER:POINTER
<vars ratio = series(priceVXV/priceVXMT);>

Any idea ? Any help is welcome.
Thank's in advance !
JC
Posted By: wingt

Re: Beginner question : vars and series - 07/15/16 16:18

try this:
vars ratio = series(priceVXV[0]/priceVXMT[0]);
Posted By: jc45

Re: Beginner question : vars and series - 07/15/16 16:48

Thank's a a lot Wingt !
I try quickly and it seems to work.
JC
© 2024 lite-C Forums