Percent change from after hours prior day to current day


Category:
0
0

Is there a script to calculate the percent change from after hours close the prior day to current price the following day? Or thoughts? It only seems to use regular hrs close.

Marked as spam
Posted by (Questions: 3, Answers: 2)
Asked on May 14, 2020 6:06 pm
174 views
0
Private answer

This is not a scan. A scan is a true/false filter that returns a list of stocks meeting the scan criteria. There is no criteria here. You are asking if it is possible to compute a value. Yes, it is possible to compute this value. But it will not result in a scan. Please provide more details so we understand what you are actually requesting.

Edit: The comment section below shows the following specifications: "Looking for percent change from after hours close from prior day to current days high to be less than 10% high". If we take away the last word in the sentence we have a scan. Not sure why the word high was included at the end.

Now, here is the problem. There is no such thing as "after hours close". There is such as things as "last trade before midnight during extended hours session". But there is nothing such as an official after hours close. In fact there are some stock tickers that trade 24 hours a day like futures. So the first goal is how to grab the last trade prior to midnight. Then we also need to track the highest high for the new trading day. Then compute the percent difference so that we can build our final statement that checks if the difference is less than 10%.

input percentThreshold = 10.0;
def newDay = GetDay() <> GetDay()[1];
rec trackClose = if newDay[-1] then close else trackClose[1];
rec trackHigh = if newDay then high else if high > trackHigh[1] then high else trackHigh[1];
def percentDifference = 100 * (trackHigh / trackClose - 1);
plot scan = percentDifference < percentThreshold;

You add this to a new Study Filter of a scan and make sure you set to any intraday time frame and check the box to included extended hours.

This scan will return virtually ever ticker symbol included in the top level filter "Scan in:" because nearly every stock is going to fit this filter every trading day of the week.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 14, 2020 8:11 pm
0
Comment: Looking for percent change from after hours close from prior day to current days high to be less than 10% high
( at May 15, 2020 4:14 am)
0
I have updated my answer to include the solution you have specified.
( at May 15, 2020 7:48 am)