SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Gary Lyben who wrote (5329)7/11/1998 2:45:00 PM
From: Johan Van Houtven  Read Replies (2) of 11149
 
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
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext