Scan for premarket low to high percent change


Category:
0
0

Hello Pete, using the code solution here . https://www.hahn-tech.com/ans/premarket-line-100-above-the-premaket-low/

how can we create a scan that shows what stocks premarket at any point whose premarket low to premarket high percent change is greater than 90%?

 

it should pick up ATXG today

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on May 15, 2025 12:56 pm
6 views
0
Private answer

You only need to remove the original plot statements and one new line of code in order to convert that solution to work as a scan. Everything is already there. You need to create a statement that checks if the current high is greater than or equal to the target price.

Here is the scan:

# adjust to set the target value for pre session high
input percentMultiplier = 0.90;
input premarketStart = 400;
input sessionStartTime = 930;
input sessionEndTime = 1615;
def regularSessionHours = SecondsFromTime(sessionStartTime) >= 0 and SecondsTillTime(sessionEndTime) >= 0;
def extendedSessionHours = !regularSessionHours;
def trackPremarket = SecondsFromTime(premarketStart) >= 0 and SecondsTillTime(sessionEndTime) > 0 and extendedSessionHours;
rec premarketLow = if !regularSessionHours[1] and regularSessionHours then Double.NaN else if !trackPremarket[1] and trackPremarket then low else if low > 0 and trackPremarket then Min(low, premarketLow[1]) else premarketLow[1];
rec targetPrice = if regularSessionHours then Double.NaN else if !trackPremarket[1] and trackPremarket then premarketLow * percentMultiplier + premarketLow else targetPrice[1];
plot scan = trackPremarket and high >= targetPrice;

This scan will only work during the premarket hours. Once the regular session begins, the scan will produce zero results.

Marked as spam
Posted by (Questions: 37, Answers: 4133)
Answered on May 15, 2025 12:59 pm
0
Is there a way to make the results persist throughout the day for what extended premarket ?
( at May 15, 2025 1:37 pm)
0
There is a way to do that. But that would be a bit beyond the scope of what I am able to provide free of charge in the Q&A Forum. The issue is that your original question specifically stated that you wanted both lines to stop plotting once the premarket session had ended. That took quite a bit of extra work to complete. And it would require quite a bit of more work to unravel that.
( at May 15, 2025 1:42 pm)