Thread
this line
StochRSI:=StochRSI+((rsi(j-(maperiod2-p))-min(j-(maperiod2-p),
from the Andy Gabor #93 short scan is giving me an error when I try to run it. QP gives a "unexpected +" error and highlights the + after StochRSI.
Any help would be appreciated.
Here is the complete scan
//Andy's #93, Short Sell Version, by Andy Gabor
output ="agshort93.lst"; input="300vol.lst"; //ProcessMS =3D "d:\meta\agshort93\",VMS; daystoload= 200; daysrequired= 145; integer i, j, flag1, flag2,p; float weight, maperiod1, maperiod2, total, totaldays, StochRSI, PrvStRSI,PRVPRVSRSI,bb1, StochRSI2, PrvStRSI2, maperiod1a, maperiod2a, weighta, totala, totaldaysa, pctgain,volratio;
for p =0 to 0 step 1 do // for prior periods- use for p = -x to - y step 1 do volratio :=vol(p)/avgvol(p,p-33);
set macd = 13,34,89; set stochastic = 21,5,3; flag1 :=0; flag2 :=0; bb1 :=(stdev(p-1,p-8)/(.000001+max(p-1,p-144,hi)-min(p-1,p-144,lo)))*100;
if vol(p) > .95*avgvol(p,p-33) then if close(p) > 9.99 then // if qrs(p) > 80 or qrs(p) < 26 then //optional if close(p) < close(p-1) then if stochasticPctK(p) < StochasticPctK(p-1) then if MACD(p) < MACD(p-1) then set macd = 5,13,8; if MACD(P) < MACDSignal(p) then maperiod1:=10; maperiod2:=10; set rsi = maperiod1; weight:=0; total:=0; for i = maperiod2 to 1 step -1 do total:= total + i; next i; totaldays:=total;
StochRSI:=0; PrvStRSI:=0; PRVPRVSRSI:=0; for j = maperiod2 to 1 step -1 do weight:=((j/totaldays)*100); StochRSI:=StochRSI+((rsi(j-(maperiod2-p))-min(j-(maperiod2-p), (j-maperiod2)-(maperiod1-1-p),rsi))/(.000001+max(j-(maperiod2-p), (j-maperiod2)-(maperiod1-1-p),rsi)-min(j-(maperiod2-p), (j-maperiod2)-(maperiod1-1-p),rsi))*(weight)); PrvStRSI:=PrvStRSI+((rsi(j-(maperiod2+1-p))-min(j-(maperiod2+1-p), (j-maperiod2)-(maperiod1-p),rsi))/(.000001+max(j-(maperiod2+1-p), (j-maperiod2)-(maperiod1-p),rsi)-min(j-(maperiod2+1-p),(j-maperiod2)-(maperiod1-p),rsi))*(weight)); PRVPRVSRSI:=PRVPRVSRSI+((rsi(j-(maperiod2+2-p))-min(j-(maperiod2+2-p), (j-maperiod2)-(maperiod1+1-p),rsi))/(.000001+max(j-(maperiod2+2-p), (j-maperiod2)-(maperiod1+1-p),rsi)-min(j-(maperiod2+2-p),(j-maperiod2)-(maperiod1+1-p),rsi))*(weight));
next j; if StochRSI<70 and StochRSI>25 then if StochRSI < PrvStRSI-4 and StochRSI > PrvStRSI-16 then //SET MA'S FOR SECOND STOCHRSI maperiod1a:=8; maperiod2a:=5; set rsi = maperiod1a; weighta:=0; totala:=0; for i = maperiod2a to 1 step -1 do totala:= totala + i; next i; totaldaysa:=totala; StochRSI2:=0; PrvStRSI2:=0; for j = maperiod2a to 1 step -1 do weighta:=((j/totaldaysa)*100); StochRSI2:=StochRSI2+((rsi(j-(maperiod2a-p))-min(j-(maperiod2a-p), (j-maperiod2a)-(maperiod1a-1-p),rsi))/(.000001+max(j-(maperiod2a-p), (j-maperiod2a)-(maperiod1a-1-p),rsi)-min(j-(maperiod2a-p),(j-maperiod2a)-(maperiod1a-1-p),rsi))*(weighta)); PrvStRSI2:=PrvStRSI2+((rsi(j-(maperiod2a+1-p))-min(j-(maperiod2a+1-p), (j-maperiod2a)-(maperiod1a-p),rsi))/(.000001+max(j-(maperiod2a+1-p), (j-maperiod2a)-(maperiod1a-p),rsi)-min(j-(maperiod2a+1-p),(j-maperiod2a)-(maperiod1a-p),rsi))*(weighta)); next j; if StochRSI2 > 30 and StochRSI2 < 65 then if StochRSI2 < PrvStRSI2 then if wmovavg(p,5,cl) < wmovavg(p,13,cl) and wmovavg(p-1,5,cl) > wmovavg(p-1,13,cl) then flag1 :=1; else if wmovavg(p,5,cl) < wmovavg(p,13,cl) and PrvStRSI>PRVPRVSRSI then flag2 :=1; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; // endif;
if flag1>0 then if p < -9 then pctloss := ((Min(p+10,p+1,cl))/close(p))-1;
Println Symbol:-6,",",close(p):6:3,",", Min(p+10,p+1,cl):6:3,",",pctloss:6:3,",", StochRSI:5:1,",",StochRSI2:5:1,",",vol(p):8:0,",",avgvol(p,p-33):8:0,",", volratio,",",qrs(p):4:0,",", date(p),",","5X13short"; else Println Symbol:-6,",",Close(p):6:3,",",close(p-1):6:3,",","Brk:",",",min(p,p-9,lo):6:3,",", StochRSI:5:1,",",StochRSI2:5:1,",",vol(p):8:0,",",avgvol(p,p-33):8:0,",",volratio,",", qrs(p):4:0,",", date(p),",","5X13short";
if flag1<1 and flag2>0 then if p <-9 then Println Symbol:-6,",",close(p):6:3,",", Min(p+10,p+1,cl):6:3,",",pctloss:6:3,",", StochRSI:5:1,",",StochRSI2:5:1,",",vol(p):8:0,",",avgvol(p,p-33):8:0,",", volratio,",",qrs(p):4:0,",", date(p),",","2ndshort"; else Println Symbol:-7,",",close(p):7:3,",",close(p-1):7:3,",","Brk:",",",min(p,p-9,lo):7:3,",", StochRSI:5:1,",",StochRSI2:5:1,",",vol(p):8:0,",",avgvol(p,p-33):8:0,",",volratio,",", qrs(p):4:0,",", date(p),",","2ndshort"; endif; endif; endif; endif; next p;
thanks david |