Connors 2 Period RSI Trading Indicator for ThinkorSwim

Is it possible to create a scanner with the following conditons. Any help would be greatly apperciated.
1.The stock price must be above $5 per share.
2. The stock’s average daily volume over the past 21 days (one trading month) must be at least 250,000 shares per day.
3. The stock’s 10‐day Average Directional Index (ADX) is above 30.
4. Today the stock’s lowest price is at least 8% below the previous day’s close.
5. Today’s close is in the bottom 25% of the day’s range.
6. The ConnorsRSI(3,2,100) value of the stock is below 5


Here is the connorsrsi indicator for the scan:

Code:
# ConnorsRSI Indicator
declare lower;
input Price_RSI_Period = 3;
input Streak_RSI_Period = 2;
input Rank_Lookback = 100;
# Component 1: the RSI of closing price
def priceRSI = reference RSI("price" = close, "length" = Price_RSI_Period);
# Component 2: the RSI of the streak
def upDay = if close > close[1] then 1 else 0;
def downDay = if close < close[1] then -1 else 0;
def upStreak = if upDay != 0 then upStreak[1] + upDay else 0;
def downStreak = if downDay != 0 then downStreak[1] + downDay else 0;
def streak = upStreak + downStreak;
def streakRSI = reference RSI("price" = streak, "length" = Streak_RSI_Period);
# Component 3: The percent rank of the current return
def ROC1 = close / close[1] - 1;
def rank = fold i = 1 to Rank_Lookback + 1 with r = 0 do
r + (GetValue(ROC1, i, Rank_Lookback) < ROC1) ;
def pctRank = (rank / Rank_Lookback) * 100 ;
# The final ConnorsRSI calculation, combining the three components
plot ConnorsRSI = (priceRSI + streakRSI + pctRank) / 3;

Thank you for the Help!
 
@martyrjohn I scanned and some of the results are not accurate. look at stocks like HD, LIN, NEE and COST not accurate? Can you tweak more accurate? Maybe RSI 2 Conners scan needs to be modified or because RSI should be wilder type ? I am not the expert.
 
Any savvy geniuses out there - what does "rec usage is not allowed in this context" mean when I'm trying to set an alert for a custom indicator script (ConnorsRSI)? I also get "Error: script execution timeout" constantly when trying to run scans using this indicator. Indicator works fine on the charts. Alerts and scans are buggy. Any help is appreciated. Thank you!
qlw2vsbutiq51.png


hq2l16dutiq51.png


5y9lnifvbjq51.png
 
Last edited:
Hey all i am a newby trying to find my adult job. I have been in the army since the day after 9/11. I retire from 20 years. I am an infantryman and know my body is broke and won't be able to do physical labor when I am older. haha. I am somewhat new to the market and really enjoy all the coding and charting. I don't know how to code or strategy. I am doing the thinkorswim education on it. I find it very helpful.
I found a strategy that I would like to try
I will do try. I am trying to find away to code this strat For tos And trading view.

Cm rsi 2 lower strat
Money flow index
Rsi
Together and have a buy indicator
Cm under 3
Mfi under 20
Rsi 30 or less

Also I am trying to find a way to find support when these criteria are met.

Can someone point me in the right direction
 
@Matthew.w.mickey This will color your candles cyan if all 3 conditions are met.

Code:
declare upper;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input length_connor = 2;
input overbought_connor = 90;
input oversold_connor = 3;
input price = close;
input averageType = AverageType.WILDERS;
input overSold_MFI = 20;
input overBought_MFI = 80;
input length_MFI = 14;
input movingAvgLength_MFI = 1;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);

def NetChgAvg_connor = MovingAverage(averageType, price - price[1], length_connor);
def TotChgAvg_connor = MovingAverage(averageType, AbsValue(price - price[1]), length_connor);
def ChgRatio_connor = if TotChgAvg_connor != 0 then NetChgAvg_connor / TotChgAvg_connor else 0;

def RSI_connor = 50 * (ChgRatio_connor + 1);

def MoneyFlowIndex = Average(moneyflow(high, close, low, volume, length_MFI), movingAvgLength_MFI);

AssignPriceColor(if RSI < over_Sold and RSI_connor < oversold_connor and MoneyFlowIndex < overSold_MFI then color.CYAN else color.CURRENT);
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
255 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top