I have evaluated each of your “scans” and found many mistakes. Three screenshots are included below, each marked with a share link so you can tie them back to your original request. Comments are included for each showing where the errors are located, with brief descriptions to explain what is wrong.
From your scans I can determine you are a long way from being able to affectively apply custom code solutions to build your own custom scans. The largest hurdle you have is to grasp concept of what constitutes a scan criteria. In this case, Study Filters. In more than one instance you have applied code that outputs a value and NOT a True/False result. You really need to grasp this concept if you are to learn how to build custom scans.
True or False, that is the only acceptable data type for a Study Filter. Here are some examples to help you understand the fail-points of your scans:
Example 1
plot data = 100 * (close / close[1] - 1);
That line of code is used in one of your Study Filters. It returns the percentage value change of previous close versus current close. It’s a value. Not a True/False result.
Here is one way in which the value it produces can produce a True/False result:
def data = 100 * (close / close[1] - 1);
plot scan = data > 7.0; #percent change greater than 7
Example 2
input marketClose = 1600;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter[-1] == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
plot data = priorDayClose;
That piece of code returns the previous daily close. Once again, it is NOT a True/False result, and is therefore invalid for use as a Study Filter.
Here is one way you might use the value it produces to derive a True/False result:
input marketClose = 1600;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter[-1] == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
def data = priorDayClose;
plot scan = data > 5.0; #prior daily close greater than 5
Other Issues
As noted in the attached screenshots, there are other issues in the way you’re trying to apply some of the code. For instance the ORB Study Filter. You have applied that to what you refer to as a “premarket” scan. However the ORB stands for “Opening Range Breakout”. The very name of this code excludes premarket data, completely.
Conclusion
I suggest you dial back your expectations until you get some practice and learn how all these pieces fit together. For practice, I suggest you stick with scans that include only ONE Study Filter. When you get results you don’t expect, copy that code into a new chart study and plot the result:
declare lower;
plot data = 100 * (close / close[1] - 1);
You add the “declare lower;” line at the top to force it to plot in a lower subgraph. This will show you what the scan sees when it tries to run your code. If you get anything other than a flat line that plots at zero and occasionally spikes to one, you don’t have a True/False result and the code is invalid for use in a scan. Read that sentence again and make sure that sinks in: True equals One and False equals Zero. The scan results are coming from Study Filters that output a value of 1 for the given stock. The zeros are thrown out.
Practice, practice practice….
Thank you Pete for both your help and patience. I will apply your feedback to the revisions and will continue to master the craft.