COnnors RSI

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38601 quote
    Plscap
    Participant
    Veteran

    Bonjour Nicolas,

    Je te sollicite à nouveau pour la création du Connors RSI. J’ai cherché sur le forum et malheureusement le Connors RSi que j’ai trouvé

    ne ressemble en rien à celui de la plateforme MT4. Je me permets donc de poster le code du Connors RSI de mt4. Ca serait génial s’il pouvait

    être traduit pour prt.
    En tout cas merci pour tous ces efforts.

    Je te joins le code du Connors ainsi que quelque captures. Et si je peux abuser un peu, sur le connors il y a 2 standard déviation servant de support/resistance. Est ce qu’il

    est possible de les ajouter sur le connors?
    STD du haut (75 simple)
    STD du bas ( 50 simple)

     

    //+------------------------------------------------------------------+
    //|                                                  Connors_RSI.mq4 |
    //|                               Copyright © 2015, Gehtsoft USA LLC |
    //|                                            http://fxcodebase.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2015, Gehtsoft USA LLC"
    #property link      "http://fxcodebase.com"
    
    #property indicator_separate_window
    #property indicator_buffers 3
    #property indicator_color1 Yellow
    
    extern int RSI_Closes_Length=3;
    extern int RSI_UpClose_Length=2;
    extern int Percent_Rank_Length=100;
    extern double Overbought_Level=70.;
    extern double Oversold_Level=30.;
    extern int Price=1;    // Applied price
                           // 0 - Close
                           // 1 - Open
                           // 2 - High
                           // 3 - Low
                           // 4 - Median
                           // 5 - Typical
                           // 6 - Weighted  
    
    double CRSI[];
    double UpDown[], RSI[];
    
    int init()
    {
     IndicatorShortName("Connors RSI");
     IndicatorDigits(Digits);
     SetIndexStyle(0,DRAW_LINE);
     SetIndexBuffer(0,CRSI);
     SetIndexStyle(1,DRAW_NONE);
     SetIndexBuffer(1,UpDown);
     SetIndexStyle(2,DRAW_NONE);
     SetIndexBuffer(2,RSI);
    
     SetLevelValue(0, Overbought_Level);
     SetLevelValue(1, Oversold_Level);
    
     return(0);
    }
    
    int deinit()
    {
    
     return(0);
    }
    
    double Percent_Rank(int index)
    {
     int i;
     int Count=0;
     for (i=1;i<=Percent_Rank_Length;i++)
     {
      if (RSI[index]>RSI[index+i])
      {
       Count++;
      }
     }
     
     return (100.*(0.+Count)/(0.+Percent_Rank_Length));
    }
    
    int start()
    {
     if(Bars<=3) return(0);
     int ExtCountedBars=IndicatorCounted();
     if (ExtCountedBars<0) return(-1);
     int limit=Bars-2;
     if(ExtCountedBars>2) limit=Bars-ExtCountedBars-1;
     int pos;
     double Pr0, Pr1;
     pos=limit;
     while(pos>=0)
     {
      Pr0=iMA(NULL, 0, 1, 0, MODE_SMA, Price, pos);
      Pr1=iMA(NULL, 0, 1, 0, MODE_SMA, Price, pos+1);
      
      if (Pr0>Pr1)
      {
       if (UpDown[pos+1]>0.)
       {
        UpDown[pos]=UpDown[pos+1]+1.;
       }
       else
       {
        UpDown[pos]=1.;
       }
      }
      else
      {
       if (Pr0<Pr1)
       {
        if (UpDown[pos+1]<0.)
        {
         UpDown[pos]=UpDown[pos+1]-1.;
        }
        else
        {
         UpDown[pos]=-1.;
        }
       }
       else
       {
        UpDown[pos]=0.;
       }
      }
    
      pos--;
     } 
    
     pos=limit;
     while(pos>=0)
     {
      RSI[pos]=iRSI(NULL, 0, 1, Price, pos);
    
      pos--;
     }
       
     double RSI1, RSI2, RSI3;
     pos=limit;
     while(pos>=0)
     {
      RSI1=iRSI(NULL, 0, RSI_Closes_Length, Price, pos);
      RSI2=iRSIOnArray(UpDown, 0, RSI_UpClose_Length, pos);
      RSI3=Percent_Rank(pos);
      
      CRSI[pos]=(RSI1+RSI2+RSI3)/3.;
    
      pos--;
     }
       
     return(0);
    }
    
    
    Capture-d’écran-2017-06-19-à-15.09.17.png Capture-d’écran-2017-06-19-à-15.09.17.png
    #57076 quote
    Gianluca
    Participant
    Master

    up

    #57090 quote
    bolsatrilera
    Participant
    Master

    Bonjour, j’ai ce code indicateur Rsi Connors

    REM RSI CONNORS
    
    p=14
    alza = MAX(0, CLOSE - CLOSE[1])
    baja = MAX(0, CLOSE[1] - CLOSE)
    
    sumalza=summation[p](alza)
    sumbaja=summation[p](baja)
    
    RS=sumalza/sumbaja
    
    mioRSI = 100 - 100 / (1 + RS)
    
    RETURN mioRSI AS "RSI CONNORS", 70 as "70", 30 as "30",50 as "50"
    
    Gianluca thanked this post
    dax.png dax.png
    #57205 quote
    Gianluca
    Participant
    Master

    Merci 🙂

    #76188 quote
    Roberto S.
    Participant
    Average

    Hi, interesting, but reading this document here, it seems there are missing parts in this implementation.

    What do you think?

    Regards

    Salut, intéressant, mais en lisant ce document ici, il semble qu’il manque des parties dans cette implémentation. Qu’est-ce que tu penses? Salutations

    R

    #195887 quote
    Giuseppe
    Participant
    New

    Salut tout le monde, J’ai essayé de travailler sur cet indicateur, en fusionnant quelques codes et en suivant les détails de construction dans l’article de Connor. Le voici.

    //Connors RSI v.1 by Peppe Wolf
    
    //UpDown Streak Value
    differenza = (close-close[1])
    UpStreak = 0
    DownStreak=0
    FOR i = 1 to q
    IF differenza>0 THEN
    UpStreak = UpStreak + 1
    endif
    if differenza<0then
    DownStreak=DownStreak+1
    endif
    sommarialzi=summation[q](UpStreak)
    sommaribassi=summation[q](DownStreak)
    NEXT
    RS=sommarialzi/sommaribassi
    StreakRSI=100 - 100 / (1 + RS)
    
    
    //PercentileRank
    onedayreturn = (close-close[1])/close[1]*100
    rnkCount = 0
    count = 0
    FOR i = 1 to r-1
    count = count + 1
    IF onedayreturn[i] < onedayreturn THEN
    rnkCount = rnkCount + 1
    endif
    NEXT
    PercentileRank = (rnkCount/count)*100
    
    
    CRSI=(RSI[p](close)+StreakRSI+PercentileRank)/3
     
    RETURN CRSI AS "Connors RSI", 50 as "50", 100 as "100", 0 as "0", 70 as "70", 30 as "30"
    //return StreakRSI
    //return PercentileRank

    Je pense que le code est correct, mais peut-être que quelque chose n’est pas parfait à 100%. Lorsque l’on considère la page indiquée par Roberto et le graphique de Google / Alphabet, certaines différences apparaissent dans les valeurs des indicateurs. Vous devez ajouter dans le code la variable pour p, q et r. Ou modifiez les valeurs dans le code (3,2,100 respectivement, comme dans la version originale).

    Ciao

    Giuseppe

    Bodaris thanked this post
    #195939 quote
    robertogozzi
    Moderator
    Master

    @Giuseppe

    Publiez uniquement dans la langue du forum dans laquelle vous publiez. Par exemple, l’anglais uniquement dans les forums anglophones et le français uniquement dans les forums francophones.

    Merci 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

COnnors RSI


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Plscap @flodefacebook Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by robertogozzi
3 years, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/19/2017
Status: Active
Attachments: 2 files
Logo Logo
Loading...