Posted By: faustf
correct use of if with series ? - 01/07/21 13:53
hi guys i read a manual https://manual.zorro-project.com/series.htm , in particular this case
// correct use of conditional series
vars X = series(), Y = series();
if(priceClose() > Threshold) {
X[0] = priceClose(); // ok!
Y[0] = SMA(X,100);
...
}
i create the script like this
vars PriceHL = series(priceHigh() - priceLow());
var CellM = SMA(PriceHL, 48) + StdDev(PriceHL, 48);
if (PriceHL() > CellM)
{
printf("\nResult1 = %.f", CellM);
}
but return this error
@PriceHL_00311():syntax error
<if (PriceHL() > CellM)>
i search in manual for this error , but not find
https://zorro-project.com/manual/en/errors.htm
some one can help me ? thankz
// correct use of conditional series
vars X = series(), Y = series();
if(priceClose() > Threshold) {
X[0] = priceClose(); // ok!
Y[0] = SMA(X,100);
...
}
i create the script like this
vars PriceHL = series(priceHigh() - priceLow());
var CellM = SMA(PriceHL, 48) + StdDev(PriceHL, 48);
if (PriceHL() > CellM)
{
printf("\nResult1 = %.f", CellM);
}
but return this error
@PriceHL_00311():syntax error
<if (PriceHL() > CellM)>
i search in manual for this error , but not find
https:/
some one can help me ? thankz