blog updated on 8th July 2025
The Connors RSI (CRSI) is a composite indicator developed by Larry Connors, designed to capture short-term mean reversion opportunities in the market. Unlike the traditional RSI, Connors RSI combines three distinct components to produce a more responsive momentum oscillator that works especially well on short timeframes.
What is Connors RSI?
The indicator blends:
- Short-Term RSI of closing prices – typically with a length of 3, capturing recent momentum shifts.
- RSI of the streak length (up/down days) – measures how extended the current trend is by counting consecutive up or down closes.
- Percent Rank of the daily change over a certain period – it ranks today’s return among past N days, showing how extreme the move is.

All three values are averaged to give a single CRSI value, generally oscillating between 0 and 100. Overbought/oversold levels like 70/30 are commonly used to identify potential reversal zones.
Why use Connors RSI?
This indicator is particularly popular for short-term traders who rely on quick mean-reversion setups. By factoring in both price momentum and streak behavior, it helps identify when a stock might be overextended and due for a pullback.
AmiBroker AFL Code for Connors RSI
Below is a simple AFL script for plotting Larry Connors’ RSI in AmiBroker. It provides parameters to adjust the lengths of RSI, up-down streak RSI, and PercentRank, allowing you to experiment and optimize for your market.
_SECTION_BEGIN("Connors RSI");
// === Chart Options ===
SetChartOptions(0, chartShowArrows | chartShowDates);
// === Parameters ===
RSILen = Param("RSI Closes Length", 3, 2, 100, 1);
UDLen = Param("RSI UpClose Length", 2, 2, 100, 1);
RankLen = Param("PercentRank Length", 100, 10, 200, 1);
// === Connors RSI Calculation ===
upDays = BarsSince(C <= Ref(C, -1));
downDays = BarsSince(C >= Ref(C, -1));
upDownDays = IIf(upDays > 0, upDays, IIf(downDays > 0, -downDays, 0));
ConnorsRSI = ( PercentRank(ROC(C, 1), RankLen)
+ RSIa(upDownDays, UDLen)
+ RSI(RSILen) ) / 3;
// === Plot Connors RSI in thick yellow ===
Plot(ConnorsRSI, "Connors RSI", colorYellow, styleLine | styleThick);
// === Plot horizontal dashed lines at 70 and 30 ===
Plot(70, "", colorGrey40, styleDashed);
Plot(30, "", colorGrey40, styleDashed);
_SECTION_END();
How to use it?
- Apply this indicator on your preferred time frame (it’s often used on daily charts for stocks or hourly charts for futures).
- Look for CRSI values above 70 for potential short setups and below 30 for long opportunities. These levels can be fine-tuned based on your instrument’s volatility.
- Always confirm signals with price action or other filters like trend direction.
Final thoughts
The Connors RSI is a handy tool for traders who want a bit more depth than the classic RSI. By blending three perspectives on price action, it often provides earlier and more nuanced overbought/oversold signals. Test it thoroughly on historical data to understand its behavior before applying it live.
It’s giving Syntax error on line 11 & 13.
Pls help sir.
Which Amibroker Version you are using?
Sir . it’s 5.3
Had read in TJ that some function ( percentrank or so) is absent in 5.3 and the member posted solution.
But since i am newbie,will be kind of u if u can gimme some simple solution.
thanks
It gives following error.
Line 12, Col: 27; Error 30: Syntex error
Line 14, Col: 18; Error 29: Variable ‘crsi’ used without having initialized
PLease help..
You can initialize. Add the following code in the 8th line. However it is not mandatory here
crsi =0;
Hi Rajandran,
I’m using 5.30.4
yes that is optional, crsi=0;
In spite of adding it also, I’ve same issue.
Once I remove “PercentRank(ROC(C,1), lenROC)”, No more issue.
What is going wrong with it?
Please share your thoughts and help us.
Thanks
Mahender
@Mahendar,
Percentile rank function does works with Amibroker 5.3 and lower versions.
sir, my amibroker version is 6.39,and i have the same issue,how can i solve it
try the updated code
Hi Rajandran,
I have seen your supertrend indicator for metasock, I was wondering if you can/ have coded Connors RSI for metastock. Any help will be highly appreciated.
Regards
Mahesh
Dear Mr. Rajandran,
Please guide us how we can add explore code for connorsRSI for stock selection.
Your help will highly appreciated.
Regards,
Chandrakant
Dear Rajandran ,
Is there any source from where i can get MCX-SX Currency EOD data in metastock form .
Thanks & Regards
Abhay Mehrotra
pls correct this afl
_SECTION_BEGIN(“sell buy”);
SetChartOptions(1,chartShowArrows|chartShowDates|chartWrapTitle);
Title = EncodeColor(colorYellow)+ Name() + ” – ” + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorSkyblue) +
” – ” + Date() +” – “+”
” +EncodeColor(colorYellow) +”Open-“+O+” “+”High-“+H+” “+”Low-“+L+” “+”Close-“+C+” “+ “Volume= “+ WriteVal(V);
//SetBarsRequired(100000,0);
GraphXSpace = 15;
EntrySignal = F1();
ExitSignal = F2();
Color = IIf( EntrySignal, colorBlue, IIf( ExitSignal, colorRed, colorGrey50 ));
Plot( C, “Price”, Color, styleBar | styleThick );
SetChartBkColor(ParamColor(“Outer panel color “,colorLightYellow));
SetChartBkColor(ParamColor(“BackGround Color”, colorDarkGrey));
messageboard =ParamToggle(“Message Board”,”Show|Hide”,1);
target = Optimize(“Target”,Param(“Target (Change To Optimise)”,10,0.05,1000,0.05),0.05,1000,0.05);
AutoTarget = ParamToggle(“Auto Target Mode”, “Yes|No”,1);
AudioAlert = ParamToggle(“Human Voice Alert”, “No|Yes”);
EmailAlert = ParamToggle(“E-mail Alert”, “No|Yes”);
AlertOutput = ParamToggle(“Alert Output”, “No|Yes”);
starttime=Param(“Market Start Time”,091500,000000,235959,1 );
endtime=Param(“Market End Time”,152500,000000,235959,1 );
BackTestMode = ParamToggle(“Use Back Tester Settings”, “Yes|No”);
Param_Margin = Param(“Margin required (used for backtesting only)”, 15,0.001,100,0.001);
Param_LotSize = Param(“Lot Size (used for backtesting only)”, 50,1,50000,1);
Param_NoOfLots = Param(“No of lots normally traded (used for backtesting only)”,1,1,10000,1);
ConstantLot = ParamToggle(“Trade Constant Lot”, “No|Yes”);
C13=20;
C14=2.1;
C15=12;
Miny = Status(“axisminy”);
Maxy = Status(“axismaxy”);
lvb = Status(“lastvisiblebar”);
fvb = Status(“firstvisiblebar”);
pxwidth = Status(“pxwidth”);
pxheight = Status(“pxheight”);
#include_once “SS_include.afl”
bars = LastValue( IIf(BarsSincebuy endtime AND NOT Relax)==1) Say(“Exit position in “+Name()+” at current market price “+C);
if (SelectedValue(bookshort AND NOT Short AND NOT Relax)==1) Say(“Target achieved in short in “+Name()+” at “+tar);
if (SelectedValue(booklong AND NOT Buy AND NOT Relax)==1) Say(“Target achieved in long in “+Name()+” at “+tar);
}
if (EmailAlert==True)
{
AlertIf( Buy, “EMAIL”, “Long signal generated on “+FullName(), 1 );
AlertIf( booklong AND NOT Buy AND NOT Relax, “EMAIL”, “Target achieved in long in “+FullName(), 1 );
AlertIf( Short, “EMAIL”, “Short signal generated on “+FullName(), 1 );
AlertIf( bookshort AND NOT Short AND NOT Relax, “EMAIL”, “Target achieved in long in “+FullName(), 1 );
AlertIf( TimeNum() > endtime AND NOT Relax, “EMAIL”, “Exit position in “+FullName(), 1 );
}
if (AlertOutput==True) {
AlertIf( Buy, “”, “Buy Signal Generated”+Name(), 4 );
AlertIf( booklong AND NOT Buy AND NOT Relax, “”, “Target achieved in long in “+Name(), 4 );
AlertIf( Short, “”, “Short Signal Generated”+Name(), 4 );
AlertIf( bookshort AND NOT Short AND NOT Relax, “”, “Target achieved in short in “+Name(), 4 );
AlertIf( TimeNum() > endtime AND NOT Relax, “”, “Exit position in “+Name(), 4 );
}
if
(messageboard == 1 )
{
GfxSelectFont( “Tahoma”, 13, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor
( colorWhite );
if ( SelectedValue( LastSignal ) == 1 )
{
GfxSelectSolidBrush( colorDarkBlue );
}
else
{
GfxSelectSolidBrush( colorDarkRed );
}
pxHeight = Status( “pxchartheight” ) ;
xx = Status( “pxchartwidth”);
Left = 1100;
width = 310;
x = 5;
x2 = 290;
y = pxHeight;
GfxSelectPen
( colorLightBlue, 1); // border color
GfxRoundRect
( x, y – 90, x2, y , 7, 7 ) ;
GfxTextOut
( (“For Enquiry: buy sell”),13,y-85);
GfxTextOut
( (“” + WriteIf(Buy, “Go Long At “+C+” – SL ” +sl,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (Short, “Go Short At “+C+” – SL ” +sl,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (TimeNum() > endtime AND NOT Relax, “Exit Position At “+C,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (Long AND NOT Buy, “Long At “+BuyPrice+” – SL ” + sl + “”,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (shrt AND NOT Short, “Short At “+ShortPrice+” – SL ” + sl + “”,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (Relax, “Not In Trade – RELAX!!!”,””)), 13, y-65);
GfxTextOut
( (“” + WriteIf (shrt AND NOT Short, “Current P/L: “+(ShortPrice-C)+” Points”,””)), 13, y-45);
GfxTextOut
( (“” + WriteIf (Long AND NOT Buy, “Current P/L: “+(C-BuyPrice)+” Points”,””)), 13, y-45);
GfxTextOut
( (“” + WriteIf (bookshort AND NOT Short AND NOT Relax, “Profit Booked: “+(ShortPrice-tar)+” Points”,””)), 13, y-45);
GfxTextOut
( (“” + WriteIf (booklong AND NOT Buy AND NOT Relax, “Profit Booked: “+(tar-BuyPrice)+” Points”,””)), 13, y-45);
GfxTextOut
( (“” + WriteIf (Long OR Buy OR Shrt OR Short, “Target: “+tar,””)), 13, y-25);
GfxTextOut
( (“” + WriteIf (booklong AND NOT Buy AND NOT Relax, “Target Done: “+tar,””)), 13, y-25);
GfxTextOut
( (“” + WriteIf (bookshort AND NOT Short AND NOT Relax, “Target Done: “+tar,””)), 13, y-25);
}
GfxSetBkMode( 1 );
GfxSelectFont(“Tahoma”, Status(“pxheight”)/C13);
GfxSetTextAlign( 6 );
GfxSetTextColor( ColorRGB (217,217,213));
GfxTextOut( “buy sell”, Status(“pxwidth”)/C14, Status(“pxheight”)/C15 );
GfxSelectFont(“Tahoma”, Status(“pxheight”)/C13*0.5 );
GfxSetTextColor( ColorRGB (103,103,103));
GfxTextOut( “By”, Status(“pxwidth”)/C14, Status(“pxheight”)/C15*2.5 );
GfxSelectFont(“Tahoma”, Status(“pxheight”)/C13*0.5 );
GfxSetTextColor( ColorRGB (103,103,103));
GfxTextOut( “buy sell”, Status(“pxwidth”)/C14, Status(“pxheight”)/C15*4 );
GfxSelectFont(“MS Sans Serif”, 10, 500, False, False, 0);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-25);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-35);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-30);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=25);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=35);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-30);
PlotShapes(IIf(TimeNum() > endtime AND Long, shapeHollowStar, shapeNone),colorGold, 0,H, Offset=15);
PlotShapes(IIf(TimeNum() > endtime AND Shrt, shapeHollowStar, shapeNone),colorGold, 0,L, Offset=-15);
PlotShapes(IIf(Sell AND NOT Short, shapeStar, shapeNone),colorRed, 0, H, Offset=15);
PlotShapes(IIf(Cover AND NOT Buy, shapeStar, shapeNone),colorBlue, 0,L, Offset=-15);
PlotShapes(IIf(booklong AND NOT Buy AND NOT Relax, shapeStar, shapeNone),colorRed, 0, H, Offset=15);
PlotShapes(IIf(bookshort AND NOT Short AND NOT Relax, shapeStar, shapeNone),colorBlue, 0,L, Offset=-15);
//Settings for Backtester
if (BackTestMode==True)
{
SetOption(“AllowSameBarExit”, False);
SetOption(“AllowPositionShrinking”, False);
SetOption(“FuturesMode”, True);
SetOption(“InterestRate”,0);
SetOption(“MaxOpenPositions”,1);
RoundLotSize = Param_LotSize;
SetOption(“MinShares”,RoundLotSize);
SetOption(“PriceBoundChecking”,False);
//SetOption(“CommissionMode”,3);
//SetOption(“CommissionAmount”,12.5/RoundLotSize);
SetOption(“AccountMargin”,Param_Margin);
SetOption(“ReverseSignalForcesExit”,True);
SetOption(“UsePrevBarEquityForPosSizing”,True);
ApplyStop(stopTypeTrailing, stopModePoint, TSL, True, True );
if (ConstantLot==True)
{
PositionSize = C*RoundLotSize*Param_NoOfLots;
}
SetTradeDelays(0,0,0,0);
BuyPrice = Close;
SellPrice = Close;
ShortPrice = Close;
CoverPrice = Close;
}
_SECTION_END();
Rajandren Sir, Did u correct Mr.Anil’s request ?
it showing error in #include_once “SS_include.afl”
Do we need SS_include.afl indicator ?
Pls guide me
hello
i would like to know the above mentioned connors rsi work with esignal or it has to modified ,if so pls modify it , it will be helpfull.
thanks.
hello sir i am using MT4 demo softwar i want mcx commodity live chat for lowest cost pls help me sir
Have you seen or do you know how to code connorsrsi for Excel?
-T.M. in Scottsdale
I too would love to have a copy of Connorsrsi for Excel, if anyone has it…
Thank you
JWT