Need help with Conner's scan

H

Heloyguerra

New member
I had this custom coded but im not getting many signals when I do get a signal it works great but its once in a blue moon. Can someone look and see if you can tweek for more signals?

Code:
# MTS200517 Scan for Hector eml
# Name: MTS_HectorII_200517Scan
# Intended to run on daily TF only
declare hide_on_intraday;
Declare Lower;
Input W_PercentBelowPriorClose = 3;
Input X_BottomPercentileLimit = 10;
Input ConnorsRSILimit = 5;

Def CloseCond = close>5;
Def AvgVolCond = average(volume,21)>250000;
Def ADXCond = ADX(10)>30;
Def WCond = low<(100-W_PercentBelowPriorClose)/100*Low[1];
Def XCond = High-close > (100-X_BottomPercentileLimit)/100 * (high-low);

# MTS2005 Connors RSI Interpretation
# declare lower;
input ClasicRSILenght = 3;
input StreakRSILenght = 2;
input PercentRankLookback = 30;
# Clasic RSI
def priceRSI = RSI(ClasicRSILenght);
# RSI of the streak
def upDay = close > close[1];
def downDay = close < close[1];
def upStreak = if upDay then upStreak[1] + upDay else 0;
def downStreak = if downDay then downStreak[1] - downDay else 0;
def streak = upStreak + downStreak;
def streakRSI = RSI("price" = streak, "length" = StreakRSILenght);
# Percent rank
def ROC1 = close / close[1] - 1;
def rank = fold i = 1 to PercentRankLookback + 1 with r = 0 do
r + (GetValue(ROC1, i, PercentRankLookback) < ROC1) ;
def pctRank = (rank / PercentRankLookback) * 30 ;
# ConnorsRSI Final
Def ConnorsRSI = (priceRSI + streakRSI + pctRank) / 3;

Def ConnorsCond = ConnorsRSI<ConnorsRSILimit;

Plot Scan =  CloseCond AND AvgVolCond AND ADXCond AND WCond AND XCond AND ConnorsCond;
 
Last edited by a moderator:
Prison Mike

Prison Mike

Member
There is 6 conditions that need to be met. Either don’t make them as selective, remove some or lower the time frame.

Here’s two cents.
 
H

Heloyguerra

New member
@Prison Mike since i don't know how to make the changes could you kindly change to what you think will work and repost thank you
 
Prison Mike

Prison Mike

Member
I’ll play around with it when I can.

I would advise to learn what the code is doing and play around with the values in this part of the code .

Input W_PercentBelowPriorClose = 3;
Input X_BottomPercentileLimit = 10;
Input ConnorsRSILimit = 5;

Def CloseCond = close>5;
Def AvgVolCond = average(volume,21)>250000;
Def ADXCond = ADX(10)>30;
Def WCond = low<(100-W_PercentBelowPriorClose)/100*Low[1];
Def XCond = High-close > (100-X_BottomPercentileLimit)/100 * (high-low);
 
M

martyrjohn

Member
Whats your strategy with this? Buy when RSI(2) is under 5 in an uptrend?
 
H

Heloyguerra

New member
That was the original intention but for some reason it’s in reverse if it triggers it triggers a down trend At a high percentage, if it triggers near a low the reversal is an uptrend. I back tested and it’s very accurate for a down trend
 
C

CFA312

New member
how you backtested it? Just manually run using on-demand function?
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
how you backtested it? Just manually run using on-demand function?

Make it a normal upper study, then go to setting and set the scan to plot a down arrow.

I like this guys style, who is he? Does he have a youtube. These selective kind of scripts are the key to the markets, most think they can use an indicator that just switches from green to red but those never work, you need extremely specific parameters like this.

I'm dumb asf, I assume it's just using conners rsi and Conner isn't a person. 🤦‍♂️
 
Last edited by a moderator:
H

Heloyguerra

New member
@YungTraderFromMontana im not a technical person I’m more visual. Yes it’s using Conner rsi which is way over my head but the signals a spec on. will this work in the upper study do you have to Change anything in the code

here is lower study

Code:
# MTS200517 Scan for Hector eml
# Name: MTS_HectorII_200517Scan
# Intended to run on daily TF only
declare hide_on_intraday;
Declare Lower;
Input W_PercentBelowPriorClose = 3;
Input X_BottomPercentileLimit = 10;
Input ConnorsRSILimit = 5;

Def CloseCond = close>5;
Def AvgVolCond = average(volume,21)>250000;
Def ADXCond = ADX(10)>30;
Def WCond = low<(100-W_PercentBelowPriorClose)/100*Low[1];
Def XCond = High-close > (100-X_BottomPercentileLimit)/100 * (high-low);

# MTS2005 Connors RSI Interpretation
# declare lower;
input ClasicRSILenght = 3;
input StreakRSILenght = 2;
input PercentRankLookback = 30;
# Clasic RSI
def priceRSI = RSI(ClasicRSILenght);
# RSI of the streak
def upDay = close > close[1];
def downDay = close < close[1];
def upStreak = if upDay then upStreak[1] + upDay else 0;
def downStreak = if downDay then downStreak[1] - downDay else 0;
def streak = upStreak + downStreak;
def streakRSI = RSI("price" = streak, "length" = StreakRSILenght);
# Percent rank
def ROC1 = close / close[1] - 1;
def rank = fold i = 1 to PercentRankLookback + 1 with r = 0 do
r + (GetValue(ROC1, i, PercentRankLookback) < ROC1) ;
def pctRank = (rank / PercentRankLookback) * 30 ;
# ConnorsRSI Final
Def ConnorsRSI = (priceRSI + streakRSI + pctRank) / 3;

Def ConnorsCond = ConnorsRSI<ConnorsRSILimit;

Plot Scan =  CloseCond AND AvgVolCond AND ADXCond AND WCond AND XCond AND ConnorsCond;

Larry conner
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
@Heloyguerra Nothing has to be changed, just go into the settings and make the scan plot a arrow
 
H

Heloyguerra

New member
@YungTraderFromMontana I tried plotting the arrow but I think im doing something wrong can you post example
 
M

martyrjohn

Member
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!
 
H

Heloyguerra

New member
@martyrjohn is this what your looking for

Code:
# MTS200517 Scan for Hector eml
# Name: MTS_HectorII_200517Scan
# Intended to run on daily TF only
declare hide_on_intraday;
Declare Lower;
Input W_PercentBelowPriorClose = 3;
Input X_BottomPercentileLimit = 10;
Input ConnorsRSILimit = 5;

Def CloseCond = close>5;
Def AvgVolCond = average(volume,21)>250000;
Def ADXCond = ADX(10)>30;
Def WCond = low<(100-W_PercentBelowPriorClose)/100*Low[1];
Def XCond = High-close > (100-X_BottomPercentileLimit)/100 * (high-low);

# MTS2005 Connors RSI Interpretation
# declare lower;
input ClasicRSILenght = 3;
input StreakRSILenght = 2;
input PercentRankLookback = 30;
# Clasic RSI
def priceRSI = RSI(ClasicRSILenght);
# RSI of the streak
def upDay = close > close[1];
def downDay = close < close[1];
def upStreak = if upDay then upStreak[1] + upDay else 0;
def downStreak = if downDay then downStreak[1] - downDay else 0;
def streak = upStreak + downStreak;
def streakRSI = RSI("price" = streak, "length" = StreakRSILenght);
# Percent rank
def ROC1 = close / close[1] - 1;
def rank = fold i = 1 to PercentRankLookback + 1 with r = 0 do
r + (GetValue(ROC1, i, PercentRankLookback) < ROC1) ;
def pctRank = (rank / PercentRankLookback) * 30 ;
# ConnorsRSI Final
Def ConnorsRSI = (priceRSI + streakRSI + pctRank) / 3;

Def ConnorsCond = ConnorsRSI<ConnorsRSILimit;

Plot Scan =  CloseCond AND AvgVolCond AND ADXCond AND WCond AND XCond AND ConnorsCond;
 
M

martyrjohn

Member
@Heloyguerra Perfect. If you find a way to get any more results from the scan let me know.
 
M

martyrjohn

Member
Hello is there any way you can help me with this. I use this code to scan for stocks under connorsrsi5. However, it keeps saying script execution timed out. I made a support request and asked the TD Ameritrade staff and they say sometimes if a script is to complex it times out and to fix it I need to break up my script to separate multiple scripts. Any ideas on how I can do this.

This is the script:

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;
 
V

Vimal Mittal

Member
@YungTraderFromMontana im not a technical person I’m more visual. Yes it’s using Conner rsi which is way over my head but the signals a spec on. will this work in the upper study do you have to Change anything in the code

here is lower study

Code:
# MTS200517 Scan for Hector eml
# Name: MTS_HectorII_200517Scan
# Intended to run on daily TF only
declare hide_on_intraday;
Declare Lower;
Input W_PercentBelowPriorClose = 3;
Input X_BottomPercentileLimit = 10;
Input ConnorsRSILimit = 5;

Def CloseCond = close>5;
Def AvgVolCond = average(volume,21)>250000;
Def ADXCond = ADX(10)>30;
Def WCond = low<(100-W_PercentBelowPriorClose)/100*Low[1];
Def XCond = High-close > (100-X_BottomPercentileLimit)/100 * (high-low);

# MTS2005 Connors RSI Interpretation
# declare lower;
input ClasicRSILenght = 3;
input StreakRSILenght = 2;
input PercentRankLookback = 30;
# Clasic RSI
def priceRSI = RSI(ClasicRSILenght);
# RSI of the streak
def upDay = close > close[1];
def downDay = close < close[1];
def upStreak = if upDay then upStreak[1] + upDay else 0;
def downStreak = if downDay then downStreak[1] - downDay else 0;
def streak = upStreak + downStreak;
def streakRSI = RSI("price" = streak, "length" = StreakRSILenght);
# Percent rank
def ROC1 = close / close[1] - 1;
def rank = fold i = 1 to PercentRankLookback + 1 with r = 0 do
r + (GetValue(ROC1, i, PercentRankLookback) < ROC1) ;
def pctRank = (rank / PercentRankLookback) * 30 ;
# ConnorsRSI Final
Def ConnorsRSI = (priceRSI + streakRSI + pctRank) / 3;

Def ConnorsCond = ConnorsRSI<ConnorsRSILimit;

Plot Scan =  CloseCond AND AvgVolCond AND ADXCond AND WCond AND XCond AND ConnorsCond;

Larry conner
It shows a straight blue line on zero mark on any stock at below chart?
I need an indicator below chart to create 2 period RSI Larry conners. Thanks.
 
W

wborden44

New member
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!




 
Last edited:
MerryDay

MerryDay

Active member
VIP
The fold command in the script you are using makes your study incompatible with the TOS alert function
 

Similar threads

Top