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 -- Ignore unavailable to you. Want to Upgrade?


To: Bob Jagow who wrote (6519)9/14/1998 2:30:00 PM
From: Craig DeHaan  Read Replies (1) | Respond to of 11149
 
Sean, Bob,
M. thanks for the tips. I'm still unclear where "convention" would exactly place the added lines in your suggestions, i.e. where integers / variables can be called and modified within the code sequence; are there any repetive, unnecessary or misbegotten instances as I've written it here. It seems to perform as intended (tho I don't really understand why <g>), but would appreciate opinions of any blatant code-inefficiency suggestions. You're great teachers. I'm a slow pupil.

// BBB (by R. Estes) variation of the 5pctvol.scn looped 17 days

output="Bbbloop.lst";
ProcessMS = "c:\meta\bbbloop",MSDATA;
integer i,j;
j:=0;
For i = 0 to -17 step -1
Do
If j=0 and // <<<----added this-------<<<
Close(i) > Min(i-1,i-5,cl)*1.05 and
Close(i) > Max(i-1,i-260,cl)*.85 and
Vol(i) >= AvgVol(i,-65) and
AvgVol(i,-130) >= 30000 and
Vol(i) >= 30000 and
QRS(i) > 80 then
j:=j+1; // <<<----added this-------<<<
println symbol;
endif;
next i;



To: Bob Jagow who wrote (6519)9/14/1998 3:13:00 PM
From: Johan Van Houtven  Respond to of 11149
 
QPv2 wizards,

Does anyone have any idea why the following scan doesn't generate any output IF one removed the "//" in the 4th last line (// MaxHi := Max(0,NumDays,hi);) ?

This is truely mind-boggling. I'm quite sure this scan worked perfectly before I updated QPv2 to the last version.

Am I overlooking something obvious?

Here's the input data for the "jvh-stocks-in.lst" file:

BMCS
CEFT
EMC
JKHY
METG
NSIT
NTAP
SBL
CPWR
LGTO
NEON

//JVH stock data Scan by JVH
input = "jvh-stocks-in.lst";
output = "jvh-stocks-out.lst";

Float SMA17, SMA50, SMA200, MaxHi;
Integer NumDays;

DaysToLoad=1040;

if DaysLoaded < 200 then // If there are less than 200 days of data available
SMA17 :=MovAvg(0,17,cl);
SMA50 :=MovAvg(0,50,cl);
NumDays:=((DaysLoaded-1)*-1);
if Numdays <= 0 then // if...endif to avoid QPv2 parsing bug in Max(x,y,z)
MaxHi := Max(0,NumDays,hi);
Println NumDays; //symbol, ",", Description:30, "," , close(0):7:2, ",", AvgVol(0,-29):10:0, "," , IRLsymbol:9, ",", QRS(0):3, ",", MaxHi; // :7:2, ",", SMA17:7/2, ",", SMA50:7:2, ",", "N/A":7, ",", (SMA50*1.3):7:2, ",", "N/A":7;
endif;
else // There are at least 200 days of data available
SMA17 :=MovAvg(0,17,cl);
SMA50 :=MovAvg(0,50,cl);
SMA200 :=MovAvg(0,200,cl);
NumDays:=((DaysLoaded-1)*-1);
if Numdays <= 0 then // if...endif to avoid QPv2 parsing bug in Max(x,y,z)
// MaxHi := Max(0,NumDays,hi);
Println NumDays; //symbol, "," , Description:30, "," , close(0):7:2, ",", AvgVol(0,-29):10:0, "," , IRLsymbol:9, ",", QRS(0):3, ",", MaxHi; // :7:2, ",", SMA17:7:2, ",", SMA50:7:2, ",", SMA200:7:2, ",", (SMA50*1.3):7:2, ",", (SMA200*1.7):7:2;
endif;
endif;

Johan