• LIMITED TIME OFFER: use coupon code PRIMEDAY at checkout to save $50 off VIP membership (down to $149 / year). Valid through Tuesday 6/22.

Scan for stocks with lowest RSI and MACD

ZilluZim

New member
Hi, Need to create a scanner for stocks with the following condition.

Find stock with the lowest RSI and MACD values. These lowest values should be in the range of +/-x bars from each other.

Following diagram is sample representation of aforementioned condition. Can someone please help with it? I tried to set it up using predefined option in ThinkOrSwim but couldn't get it right.

cTAPKL8.png
 

XeoNoX

Well-known member
VIP
since the macd/rsi follow price you are doing the same thing as looking up the lowest price of the past year

TOS has a built in scan to find the lowest low (lowest price) of the past 52 weeks (bars).
 

XeoNoX

Well-known member
VIP
You can confirm what I said @ZilluZim with the scan below. here is one of the 2 you requested since they do the same thing i just made it for your satisfaction.

MACD is at the lowest data point of the past 252 Days (set aggregation to day)
Code:
#
declare lower;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
def Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
plot scan= getminValueOffset(value,252) <1;
 

kyuts

New member
Use this in conjunction with range for Stock Last Price and Volume etc., else script times out.

Code:
declare lower;

##Daily
input howFarBack = 200;

##MACD
def MACDValue = reference MACD().VALUE;

##RSI
def rsiValue = reference RSI()."RSI";
def rsiOverS = rsiValue <=30;

##Scanner
plot scan = macdValue < Lowest(macdValue[1], howFarBack) and rsiValue < Lowest(rsiValue[1], howFarBack) and rsiOverS;
 

Similar threads

Top