DIVERGENCE DYNAMIC ZONE RSI

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #124701 quote
    bona25
    Participant
    Senior

    Bonjour Nicolas,

    Pourrais tu s’il te plait me programmer de la manière suivante l’indicateur Dynamic Zone RSI

    Par avance merci.

    Ps: capture d’écran

    Capture-d’écran-2020-04-05-à-12.44.46.png Capture-d’écran-2020-04-05-à-12.44.46.png
    #124774 quote
    Nicolas
    Keymaster
    Master

    Sur l’image que tu as partagé, tu décris une stratégie de trading automatique, n’est ce pas ? Il faudrait tout d’abord arriver à trouver ces fameuses divergences que tu pointes. Hors comment les trouver ? Tu indiques des points bas sur le prix qui n’en sont pas. En général on utilise des pics et des creux pour bien marquer les points hauts et bas et les comparer aux données de l’oscillateur (fractals, zigzag, canaux haut/bas, ..).

    #124783 quote
    bona25
    Participant
    Senior

    Bonjour Nicolas,

    Pour répondre à tes questions:

    – Oui effectivement au final une stratégie. Mais j’aimerai aussi avoir un indicateur comme celui que tu as fait sur le RSI classique (PRC_AnotherRSIdivergences).

    – Pour trouver les divergences je m’appuie sur le RSI classique. A savoir 70 correspond à Upband et 30 à DownBand.

    Ps: autre exemple capture d’écran.

    Merci à toi.

    Capture-d’écran-2020-04-06-à-11.11.04.png Capture-d’écran-2020-04-06-à-11.11.04.png
    #124860 quote
    Nicolas
    Keymaster
    Master

    Tu trouveras ci-dessous l’indicateur ‘Another RSI divergences’ utilisant le DynamicZoneRSI en lieu et place du RSI traditionnel (ce sont uniquement les zones de sur-achat et de sur-vente qui changent, celles-ci sont dynamiques).

    //PRC_AnotherRSIdivergences | indicator
    //DynamicZoneRSI version 
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    RSIp=14 //RSI period
    minimalBars=5 //minimal count of bars where RSI is ob or os
    // --- end of settings
    
    irsi = rsi[RSIp]
    obLevel = average[20](rsi[rsip])+std[20](rsi[rsip])*0.8
    osLevel = average[20](rsi[rsip])-std[20](rsi[rsip])*0.8
    ob = irsi>obLevel
    os = irsi<osLevel
    
    if ob then
    if not ob[1] then
    maxrsi = 0
    maxprice = 0
    firstobbar = barindex
    endif
    maxrsi=max(maxrsi,irsi)
    maxprice=max(maxprice,high)
    if maxrsi<>maxrsi[1] then
    maxrsibar=barindex
    endif
    endif
    
    if os then
    if not os[1] then
    minrsi = 100
    minprice = close*100
    firstosbar = barindex
    endif
    minrsi=min(minrsi,irsi)
    minprice=min(minprice,low)
    if minrsi<>minrsi[1] then
    minrsibar=barindex
    endif
    endif
    
    divsell=0
    if irsi crosses under obLevel then
    //verif divergence
    div = maxprice>oldmaxprice and maxrsi<oldmaxrsi and (barindex-firstobbar)>=minimalBars
    if div then
    drawsegment(oldmaxrsibar,oldmaxrsi,maxrsibar,maxrsi) coloured(200,0,0)
    drawarrowdown(maxrsibar,maxrsi) coloured(200,0,0)
    divsell=osLevel
    endif
    oldmaxrsi = maxrsi
    oldmaxprice = maxprice
    oldmaxrsibar = maxrsibar
    endif
    
    divbuy=0
    if irsi crosses over osLevel then
    //verif divergence
    div = minprice<oldminprice and minrsi>oldminrsi and (barindex-firstosbar)>=minimalBars
    if div then
    drawsegment(oldminrsibar,oldminrsi,minrsibar,minrsi) coloured(0,200,0)
    drawarrowup(minrsibar,minrsi) coloured(0,200,0)
    divbuy=osLevel
    endif
    oldminrsi = minrsi
    oldminprice = minprice
    oldminrsibar = minrsibar
    endif
    
    return irsi style(line,2) as "RSI",obLevel coloured(168,168,168) style(dottedline,1) as "overbought level", osLevel coloured(168,168,168) style(dottedline,1) as "oversold level", divsell coloured(200,0,0) style(histogram) as "sell divergence", divbuy coloured(0,200,0) style(histogram) as "buy divergence"
    
    dynamiczonersi-divergences.png dynamiczonersi-divergences.png
    #124871 quote
    bona25
    Participant
    Senior

    Une dernière chose Nicolas, peux tu créer s’il te plait un screener avec la stratégie qui correspond à l’indicateur, en ajoutant dans le code de programmation les horaires modifiable ainsi qu’un objectif et trailing stop modifiable aussi.

    C’est super ! merci à toi.

    #124959 quote
    bona25
    Participant
    Senior

    Bonjour Nicolas,

    J’ai observé des anomalies sur l’indicateur, ci-joint capture d’écran.

    Pourrai tu s’il te plait me faire un screener avec une stratégie qui correspond à l’indicateur, en ajoutant dans le code de programmation des horaires modifiable ainsi qu’un objectif et trailing stop modifiable aussi.

    Par avance je te remercie.

    Capture-d’écran-2020-04-07-à-08.56.20.png Capture-d’écran-2020-04-07-à-08.56.20.png
    #125170 quote
    Fred23
    Participant
    Junior

    Bonjour Nicolas,

    J’ai observé des anomalies sur l’indicateur, ci-joint capture d’écran.

    Peux tu regarder s’il te plait

    Merci à toi

    Capture-d’écran-2020-04-07-à-08.56.20-1.png Capture-d’écran-2020-04-07-à-08.56.20-1.png
    #125184 quote
    Nicolas
    Keymaster
    Master

    Il n’y a pas de bugs sur ces exemples, les critères de l’indicateur que tu m’as demandé d’adapter ne sont pas en phase avec ces “divergences” que tu observes.

    Il faut aussi adapter le paramètre “minimalBars” si besoin. Si tu ne comprends pas comment cet indicateur fonctionne, voir le sujet dont il découle : Création indicateur Divergence RSI particulier

    #125206 quote
    bona25
    Participant
    Senior

    Le “minimalBars” et bien réglé sur 1 .

    Je ne comprend pas pourquoi les divergences indiqué sur la capture d’écran ne sont pas prises en compte.

     

    P

    //DynamicZoneRSI version
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
     
    // --- settings
    RSIp=14 //RSI period
    minimalBars=1 //minimal count of bars where RSI is ob or os
    // --- end of settings
     
    irsi = rsi[RSIp]
    obLevel = average[20](rsi[rsip])+std[20](rsi[rsip])*0.8
    osLevel = average[20](rsi[rsip])-std[20](rsi[rsip])*0.8
    ob = irsi>obLevel
    os = irsi<osLevel
     
    if ob then
    if not ob[1] then
    maxrsi = 0
    maxprice = 0
    firstobbar = barindex
    endif
    maxrsi=max(maxrsi,irsi)
    maxprice=max(maxprice,high)
    if maxrsi<>maxrsi[1] then
    maxrsibar=barindex
    endif
    endif
     
    if os then
    if not os[1] then
    minrsi = 100
    minprice = close*100
    firstosbar = barindex
    endif
    minrsi=min(minrsi,irsi)
    minprice=min(minprice,low)
    if minrsi<>minrsi[1] then
    minrsibar=barindex
    endif
    endif
     
    divsell=0
    if irsi crosses under obLevel then
    //verif divergence
    div = maxprice>oldmaxprice and maxrsi<oldmaxrsi and (barindex-firstobbar)>=minimalBars
    if div then
    drawsegment(oldmaxrsibar,oldmaxrsi,maxrsibar,maxrsi) coloured(200,0,0)
    drawarrowdown(maxrsibar,maxrsi) coloured(200,0,0)
    divsell=osLevel
    endif
    oldmaxrsi = maxrsi
    oldmaxprice = maxprice
    oldmaxrsibar = maxrsibar
    endif
     
    divbuy=0
    if irsi crosses over osLevel then
    //verif divergence
    div = minprice<oldminprice and minrsi>oldminrsi and (barindex-firstosbar)>=minimalBars
    if div then
    drawsegment(oldminrsibar,oldminrsi,minrsibar,minrsi) coloured(0,200,0)
    drawarrowup(minrsibar,minrsi) coloured(0,200,0)
    divbuy=osLevel
    endif
    oldminrsi = minrsi
    oldminprice = minprice
    oldminrsibar = minrsibar
    endif
     
    return irsi style(line,2) as "RSI",obLevel coloured(168,168,168) style(dottedline,1) as "overbought level", osLevel coloured(168,168,168) style(dottedline,1) as "oversold level", divsell coloured(200,0,0) style(histogram) as "sell divergence", divbuy coloured(0,200,0) style(histogram) as "buy divergence"
    
     
    

     

    eux tu s’il te plait m’ajouter en plus le code réinvestir les gains a chaque position gagnante merci à toi.

    #125207 quote
    bona25
    Participant
    Senior

    Peux tu s’il te plait me rajouter dans la programmation le code pour réinvestir les gains a chaque position gagnante.

    Merci à toi.

    #125212 quote
    bona25
    Participant
    Senior
    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position avant l'heure spécifiée
    noEntryBeforeTime = 153000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position après l'heure spécifiée
    noEntryAfterTime = 220000
    timeEnterAfter = time < noEntryAfterTime
    
    // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions pour ouvrir une position acheteuse
    ignored, ignored, ignored, ignored, indicator1 = CALL DynamicZoneRSI(close)
    c1 = (indicator1 > 0)
    indicator2 = CALL "simplified Supertrend w/o ATR"[0.005]
    c2 = (indicator2 > 0)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    ignored, ignored, ignored, indicator3, ignored = CALL DynamicZoneRSI(close)
    c3 = (indicator3 > 0)
    
    IF c3 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    ignored, ignored, ignored, indicator4, ignored = CALL DynamicZoneRSI(close)
    c4 = (indicator4 > 0)
    indicator5 = CALL "simplified Supertrend w/o ATR"[0.005]
    c5 = (indicator5 < 0)
    
    IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    indicator7, ignored, ignored, ignored, indicator6 = CALL DynamicZoneRSI(close)
    c6 = (indicator6 > indicator7)
    
    IF c6 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET TARGET pPROFIT 15
    
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

DIVERGENCE DYNAMIC ZONE RSI


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
bona25 @bona25 Participant
Summary

This topic contains 10 replies,
has 3 voices, and was last updated by bona25
5 years, 11 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/05/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...