How to create Scan criteria for gaps Plus or Minus 30cent on daily chart


Category:
0
0

Hello Hahn,

I hope all is well. The purpose of this thread is to propose how to create a thinkscipt code or condition wizard that pulls stocks on the daily chart that have atleast a 30cent  price gap to the up or down side from the previous day.

 

A Gap, when it comes to investing, is a break between prices on a stock chart that occurs when the price of a stock makes a sharp move up or down with no trading occurring in between.

 

This scan will primary be run during the premarket session.

 

As of right now as you can see in the screenshot, I currently have code that displays all gaping stocks which is fine, but as you can see it also beings back stocks with very small gaps under 30 cent change plus or minus.

 

Best

Attachments:
Marked as spam
Posted by (Questions: 22, Answers: 63)
Asked on October 11, 2018 9:19 am
160 views
0

already been asked and solved, in more ways than one: https://www.hahn-tech.com/ans/help-making-pre-market-gap-scanner-more-efficient/

( at October 11, 2018 10:57 am)
0

WOW such dedication , I will go and find the best one and contact you again if i still have any issues

( at October 11, 2018 11:10 am)
0
Hello Hahn, while all of those are great solutions, none of them seem to fully satisfy the results of this request. Essentially all i want the scanner to show is stocks that are actually gaping with the current price having a gap of at least 30 cent (positive or negative) from the previous days high . Essentially , there should be no stocks on the scanner that have filled their gap I will be running this on a 1 minute aggregation period
( at October 11, 2018 11:42 am)
0

The code provided in my answer on this post does exactly what you have requested.
https://www.hahn-tech.com/ans/help-making-pre-market-gap-scanner-more-efficient/

It even has a user input for the percent value you want to check for. It can check for gaps up as well as gaps down. I can’t imagine why the code in that post does not accomplish your stated goals. If you need something more complex than this then it’s time you started submitting your requests as custom projects subject to our rates and terms.

( at October 11, 2018 5:46 pm)
0

Okay, just to confirm, this is the code you are referring too below?

def percent_change = -5.00;
input marketClose = 1600;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter[-1] == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
# comment out yest_closing_price and replace with priorDayClose
#def yest_closing_price = close[500];
def afterhours_percent_change = 100 * ((close – priorDayClose) / priorDayClose ) ;
# comment out scan for greater than and replace with scan for less than
#plot scan = afterhours_percent_change >= percent_change;
plot scan = afterhours_percent_change

( at October 11, 2018 6:31 pm)
0

Correct, except what you copied and pasted is incomplete. The last line in the code is this:

plot scan = afterhours_percent_change <= percent_change;

( at October 11, 2018 9:32 pm)
0

sorry, i hit the text limit. I will test the code this morning and check if the code detects gaps greater than 30 cent plus or minus then remove those scan results once the gap fills less than 30 cent

( at October 12, 2018 3:18 am)