Monty, sorry, I guess I was not clear enough on my post. I rem'd out the daystoload line in your scan and added daysloaded to the println statement. This gave me the amount of days Q+ loaded by default to run the scan. I'm guessing that it needed that many for your call of -202 and the 20d sma. I then looked at the correct dates and used that number.
Kind of a rookie bass ackward reverse engineering process. But it helps me to set up a variable to troubleshoot, double check output or just try to figure out how a thing works.
So if a scan is outputing strange results or not working, set up a variable, then assign a value to it that you think may be the problem. Then put the varaible in the println statement and you can check it. In a case where the scan is self destructing, cancel it before it does (if you can) and check the variable.
I am still not clear on why [bar] does not stay at what it is begetted...
So here is how I modified your scan to give me that information:
//input="nyse.lst";
output="test.lst";
//daystoload=1000;
integer bar; bar:= -202; if Close(bar)> movavg(bar,20,cl) then
println symbol:-8,date(bar):-12,daysloaded:-8;
endif;
If I add movavg(bar,20,cl) to the println statement the scan confuses me even more... how can you have a negative ma as some come up?
not much clearer, huh! LOL bdog
|