Scan for daily price touching desired moving average?

J

jas

New member
Hi Ben,

Please, I need Thinkorswim scan which scan stocks whose last few previous daily bar's open, close, low or high touches or almost too close to desired moving averages means act as support or resistance. Can also able to scan for at least 2 different moving averages in a scan so that scan will return stocks which touches either of 2 moving averages.


Thanks
 
T

tomsk

Well-known member
VIP
Warehouse
I'll respond on behalf of @BenTen

Scanning for stocks need to be very clearly defined. Your description above is imprecise and won't mean anything to the scanner
For example you can say something like the close crosses above the 34 EMA during yesterday's close
Once you have a clear definition, scanning for that will be easy
Help us so that someone can help you
 
Last edited:
J

jas

New member
Hi Tom,

Basically looking stocks whose previous last 1-4 daily bar's open, close, high or low is very close to particular moving average which means that it acts as base.

Thanks
 
J

jas

New member


Please check image and I have highlighted points
 
Last edited by a moderator:
T

tomsk

Well-known member
VIP
Warehouse
Hi Tom,

Basically looking stocks whose previous last 1-4 daily bar's open, close, high or low is very close to particular moving average which means that it acts as base.

Thanks
You really need to define "very close" because different traders have different interpretations of what "very close" means to them
That said, assume you want to scan for stocks with a price within $0.50 of say the 21 EMA
Here is your scan code to do so.

Code:
def EMA = ExpAverage(close, 21);
plot scan = between(close, EMA-0.50, EMA+0.50);
 
J

jas

New member
Hi Tom,

Actually looking for scan which return stocks whose previous one to four daily candles either open, close, low or high touches desired moving average. Also I need unusual volume in scan and distance between 2 moving average is narrowing. Please see image below for reference as I highlighted for what I am looking for?



Thanks
 
J

jas

New member
Hi Tom,

I didn't get any response so I am writing back. Did you see my highlighted picture where I show what I am looking in the scan. Please refer to this picture and help me to build scan.

Thanks
 
T

tomsk

Well-known member
VIP
Warehouse
Having these sorts of moving averages criss-crossing each other does not give any clear signal
Worse it may give you false positives. Probably better to wait for a clearer direction.

However since you wanted it, here is an EMA Convergence scan using 8,13,21 periods
I obtained 218 results on the scanner, scanning against the S&P 500.

Code:
# EMA Convergence Scan
# tomsk
# 12.5.2019

# Scan for convergence between EMA 8,13,21

input length1 = 8;
input length2 = 13;
input length3 = 21;

def ema1  = ExpAverage(close, length1);
def ema2  = ExpAverage(close, length2);
def ema3  = ExpAverage(close, length3);

def cond1  = between(ema1, close * .995, close * 1.005);
def cond2  = between(ema2, close * .995, close * 1.005);
def cond3  = between(ema3, close * .995, close * 1.005);

plot scan = cond1 + cond2 + cond3;
# End EMA Convergence Scan
 
J

jas

New member
Thanks Tom,

Actually, I am looking for scan where daily candle's either high, low, close or low is touching desired moving average.
For reference, please see picture below.

Thanks

 
T

tomsk

Well-known member
VIP
Warehouse
Unfortunately I need to move on to other pressing projects.
You weren't clear from the get go. I really don't see the point of the request.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Like @tomsk said, you were not specific about your request from the beginning. That makes it harder for us to help. After reading your questions multiple times, I hope I understand it correctly. You can scan for stocks that are crossing a moving average. @jas I believe you can do that using the default Scanner in ThinkorSwim. You just have to build one using their Scan Editor. It's as simple as the following:



The snippet for that would be:

Code:
close crosses SimpleMovingAvg("length" = 21)."SMA"
When running this on the daily chart, it will return any stocks with the close crossing above or below the 21 simple moving average.
 
J

jas

New member
Hi Tom,

Please see below more precise picture for scanner I am looking for?

Thanks

 
H

horserider

Well-known member
VIP
Warehouse
@jas Seems you are looking for consolidation areas. Check ECI Gaussian. Maybe you can make a scan from that. Or scan for breakouts.
 

Top