ConnorsRSI
Forums › ProRealTime English forum › ProBuilder support › ConnorsRSI
- This topic has 2 replies, 3 voices, and was last updated 6 years ago by Louis Winthorp III.
-
-
07/20/2016 at 3:01 PM #10725
A request that was addressed to ProRealTime:
I have a function ConnorsRSI and would like to convert to ProRealCode
Function:
paramLenRSI = Param(“RSI Closes Length”, 3, 2, 100, 1);
paramLenUD = Param(“RSI UpClose Length”, 2, 2, 100, 1);
paramLenRank = Param(“PerecentRank Length”, 100, 10, 200, 1);function ConnorsRSI(lenRSI, lenUD, lenROC)
{
upDays = BarsSince(C <= Ref(C,-1));
downDays = BarsSince(C >= Ref(C,-1));
updownDays = IIf(upDays > 0, upDays, IIf(downDays > 0, -downDays, 0));
crsi = ( PercentRank(ROC(C,1), lenROC) + RSIa(updownDays,lenUD) +
RSI(lenRSI))/3;
return crsi;
}Can you help me?
Suggestion for an anwser:
1234567891011121314151617181920212223242526272829303132333435363738394041PeriodRSI=3PeriodUpdownlength=2PeriodROC=100Once UpLenght=0Once DownLenght=0Once updownDays=0MyRSI=RSI[PeriodRSI](close)MyROC=ROC[PeriodROC](close)if barindex > 0 thenif close > close[1] thenupDay=1downDay=0elsif close < close[1] thendownDay=1upDay=0elsedownDay=0upDay=0endifif upDay <> 0 thenUpLenght=UpLenght[1] + upDayelseUpLenght=0endifif downDay <> 0 thenDownLenght=DownLenght[1] + downDayelseDownLenght=0endifupdownDays = UpLenght + DownLenghtendifMyRSILenght=RSI[PeriodUpdownlength](updownDays)ConnorsRSI=(MyRSI+MyROC+MyRSILenght )/3return ConnorsRSI07/21/2016 at 1:04 PM #1076005/14/2018 at 1:16 PM #70352Hi, see below an update to the ConnersRSI version. The MyROC calculation above misses a component. Looking at several sources, the ROC of the current bar needs to be compared to each ROC of each bar in x-period (100 for connors).
Conners RSI12345678910111213141516171819202122232425262728293031323334353637383940414243444546PeriodRSI = 3PeriodStreak = 2PeriodROC = 100Once DownBar=0Once UpBar=0Once UpDownBars=0//Part 1 : Calculate RSIMyRSI=RSI[PeriodRSI](close)//Part 2 : Determine Streak Values and calculate a RSI over itif barindex > 0 thenif close > close[1] thenUpBar=UpBar+1DownBar=0elsif close < close[1] thenDownBar=DownBar-1UpBar=0elseDownBar=0UpBar=0endifUpDownBars = UpBar + DownBarendifMyRSILenght=RSI[PeriodStreak](UpDownBars)//Part 3 : Determine PercentRank by comparing current percentage change to 100(PeriodROC) earlier 1-candle percentage changesTodayROC = ROC[1](close)EventTeller = 0for i=0 to (PeriodROC-1) doEarlier1DayROC = ROC[1](close[1+i])if Earlier1DayROC < TodayROC THEN//Count how many times an earlier 1 candle ROC was smaller then today'sEventTeller = EventTeller + 1endifnextPercentRank = (EventTeller / PeriodROC) * 100//Part 4 : Calculate ConnersRSIConnorsRSI=(MyRSI+MyRSILenght+PercentRank )/3return ConnorsRSI as "RSIConnors"1 user thanked author for this post.
-
AuthorPosts