ConnorsRSI

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10725 quote
    HenryHenry
    Participant
    Average

    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:

    PeriodRSI=3
    PeriodUpdownlength=2
    PeriodROC=100
    
    Once UpLenght=0
    Once DownLenght=0
    Once updownDays=0
    
    MyRSI=RSI[PeriodRSI](close)
    MyROC=ROC[PeriodROC](close)
    
    if barindex > 0 then
    if close > close[1] then
    upDay=1
    downDay=0
    elsif close < close[1] then
    downDay=1
    upDay=0
    else
    downDay=0
    upDay=0
    endif
    if upDay <> 0 then
    UpLenght=UpLenght[1] + upDay
    else
    UpLenght=0
    endif
    
    if downDay <> 0 then
    DownLenght=DownLenght[1] + downDay
    else
    DownLenght=0
    endif
    updownDays = UpLenght + DownLenght
    endif
    
    MyRSILenght=RSI[PeriodUpdownlength](updownDays)
    
    ConnorsRSI=(MyRSI+MyROC+MyRSILenght )/3
    
    return ConnorsRSI
    #10760 quote
    supertitisupertiti
    Participant
    Master

    On peut rajouter les lignes de surachat / survente préconisées par Larry Connors de 10/90  en plus des traditionnelles 30/70 pour un RSI.

    #70352 quote
    Louis Winthorp IIILouis Winthorp III
    Participant
    Average

    Hi, 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).

    PeriodRSI = 3
    PeriodStreak = 2
    PeriodROC = 100
    
    Once DownBar=0
    Once UpBar=0
    Once UpDownBars=0
    
    //Part 1 : Calculate RSI
    MyRSI=RSI[PeriodRSI](close)
     
    //Part 2 : Determine Streak Values and calculate a RSI over it
    if barindex > 0 then
    if close > close[1] then
    UpBar=UpBar+1
    DownBar=0
    elsif close < close[1] then
    DownBar=DownBar-1
    UpBar=0
    else
    DownBar=0
    UpBar=0
    endif
    UpDownBars = UpBar + DownBar
    endif
     
    MyRSILenght=RSI[PeriodStreak](UpDownBars)
    
    //Part 3 : Determine PercentRank by comparing current percentage change to 100(PeriodROC) earlier 1-candle percentage changes
    TodayROC = ROC[1](close)
    
    EventTeller = 0
    for i=0 to (PeriodROC-1) do
    Earlier1DayROC = ROC[1](close[1+i])
    if Earlier1DayROC < TodayROC THEN
    //Count how many times an earlier 1 candle ROC was smaller then today's
    EventTeller = EventTeller + 1
    endif
    next
    
    PercentRank = (EventTeller / PeriodROC) * 100
    
    //Part 4 : Calculate ConnersRSI
    ConnorsRSI=(MyRSI+MyRSILenght+PercentRank )/3
     
    return ConnorsRSI as "RSIConnors"
    Nicolas thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

ConnorsRSI


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Louis Winthorp IIILouis Winthorp III
8 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/20/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...