QPv2 bug? Max(0, NumDays ,hi) can not contain a variable like NumDays in this example?
QPv2 users, please help me out. I've been trying to 'fix' this Syntax error: Day value must be less <= 0
for hours and can't find the solution.
Here's the scan I'm writing:
//JVH stock data Scan by JVH input = "jvh-stocks-in.lst"; output = "jvh-stocks-out.lst";
Float EMA17, EMA50, EMA200; Integer NumDays;
DaysToLoad(250);
if DaysLoaded < 200 then // Less than 200 days of data available EMA17 :=EMovAvg(0,17,cl); EMA50 :=EMovAvg(0,50,cl); NumDays:=((DaysLoaded-1)*-1); Println DaysLoaded,",", NumDays, ",", Max(0, NumDays ,hi); else // At least 200 days of data available EMA17 :=EMovAvg(0,17,cl); EMA50 :=EMovAvg(0,50,cl); EMA200 :=EMovAvg(0,200,cl); Println symbol, "," , Description, "," , close(0), ",", AvgVol(0,-29), "," , IRLSymbol, ",", QRS(0), ",", Max(0,-249,hi), ",", EMA17, ",", EMA50, ",", EMA200, ",", EMA50*1.3, ",", EMA200*1.7; endif;
If you run this you get the following error:
Syntax error: Day value must be less <= 0
for the line:
Println DaysLoaded,",", NumDays, ",", Max(0, NumDays ,hi);
So you might think that NumDays is not a negative value, but it is!
If you debug this by replacing the Println line with:
Println DaysLoaded,",", NumDays, ",", NumDays;
The scan prints the negative values of NumDays! Like this: -155
Any help is would be really appreciated!
Johan |