Trendline : Une approche du trading

Viewing 11 posts - 91 through 101 (of 101 total)
  • Author
    Posts
  • #180615 quote
    Manu L.
    Participant
    Average

    En quoi consiste cet indicateur : Swapping Trendline area 3 ?

    #180617 quote
    Nicolas
    Keymaster
    Master

    Sauf erreur de ma part, il est issue de ce sujet: https://www.prorealcode.com/topic/prc_quickfibtl/

    #180618 quote
    Manu L.
    Participant
    Average

    Malgré la saisie show S/R en début de code, pas d’affichage graphique !?

     

    defparam drawonlastbaronly = true
    defparam calculateonlastbars = 500
    
    showSR = 1
    //fractals
    
    cp = lookback
    if high[cp] >= highest[(cp)*2+1](high) then
    LLH = 1
    else
    LLH = 0
    endif
     
    if low[cp] <= lowest[(cp)*2+1](low)  then
    LLL = -1
    else
    LLL = 0
    endif
     
    if LLH = 1 then
    oldLTOPy = LTOPy[1]
    oldLTOPx = LTOPx[1]
    LTOPy = high[cp]
    LTOPx = barindex[cp]
    endif
     
    if LLL = -1 then
    oldLBOTy = LBOTy[1]
    oldLBOTx = LBOTx[1]
    LBOTy = low[cp]
    LBOTx = barindex[cp]
    endif
     
    //trend line
    DRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)
    DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)
     
    //support/resistance
    if showSR then
    DRAWHLINE(LTOPy) COLOURED(207,215,199,100)
    DRAWHLINE(LBOTy) COLOURED(207,215,199,100)
    endif
     
     
    barelapsedTOP=barindex-LTOPX
    barelapsedBOTTOM=barindex-LBOTX
     
    factorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)
    factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)
     
    //drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)
     
    nowTOP = LTOPy+(barelapsedTOP*factorTOP)
    drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)
     
    nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)
    drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)
     
    RETURN nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)
    
    #180619 quote
    Nicolas
    Keymaster
    Master

    Il faut appliquer l’indicateur sur le prix.

    #180620 quote
    Manu L.
    Participant
    Average

    Rien !? 🙁

    #180958 quote
    Nicolas
    Keymaster
    Master

    Dans le code ci-dessus il te manque la variable lookback à ajouter en tête de code:

    lookback = 10
    #181268 quote
    Manu L.
    Participant
    Average

    ça ne fonctionne pas !? 🙁

     

    defparam drawonlastbaronly = true
    defparam calculateonlastbars = 500
    lookback = 10
    showSR = 1
    //fractals
    
    cp = lookback
    if high[cp] >= highest[(cp)*2+1](high) then
    LLH = 1
    else
    LLH = 0
    endif
     
    if low[cp] <= lowest[(cp)*2+1](low)  then
    LLL = -1
    else
    LLL = 0
    endif
     
    if LLH = 1 then
    oldLTOPy = LTOPy[1]
    oldLTOPx = LTOPx[1]
    LTOPy = high[cp]
    LTOPx = barindex[cp]
    endif
     
    if LLL = -1 then
    oldLBOTy = LBOTy[1]
    oldLBOTx = LBOTx[1]
    LBOTy = low[cp]
    LBOTx = barindex[cp]
    endif
     
    //trend line
    DRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)
    DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)
     
    //support/resistance
    if showSR then
    DRAWHLINE(LTOPy) COLOURED(207,215,199,100)
    DRAWHLINE(LBOTy) COLOURED(207,215,199,100)
    endif
     
     
    barelapsedTOP=barindex-LTOPX
    barelapsedBOTTOM=barindex-LBOTX
     
    factorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)
    factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)
     
    //drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)
     
    nowTOP = LTOPy+(barelapsedTOP*factorTOP)
    drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)
     
    nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)
    drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)
     
    RETURN nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)
    
    #181279 quote
    Nicolas
    Keymaster
    Master

    ça fonctionne avec le code que tu as fourni, l’appliques tu sur le prix stp ?

    #181714 quote
    JJ Tec
    Participant
    Veteran

    Bonjour, J’ai une question concernnant les lignes de tendance, pourrions-nous appliquer la même idée de rupture de ligne de tendance au RSI? À quoi ressemblerait le code? Merci à tous.

    #181722 quote
    Nicolas
    Keymaster
    Master

    Le code ci-dessous trace les lignes de trendline sur l’indicateur RSI. On peut changer l’indicateur avec n’importe quel autre dans la variable “source”.

    defparam drawonlastbaronly = true
    defparam calculateonlastbars = 500
    lookback = 20
    showSR = 0
    
    source = rsi[14]
    
    //fractals
    cp = lookback
    if source[cp] >= highest[(cp)*2+1](source) then
    LLH = 1
    else
    LLH = 0
    endif
     
    if source[cp] <= lowest[(cp)*2+1](source)  then
    LLL = -1
    else
    LLL = 0
    endif
     
    if LLH = 1 then
    oldLTOPy = LTOPy[1]
    oldLTOPx = LTOPx[1]
    LTOPy = source[cp]
    LTOPx = barindex[cp]
    endif
     
    if LLL = -1 then
    oldLBOTy = LBOTy[1]
    oldLBOTx = LBOTx[1]
    LBOTy = source[cp]
    LBOTx = barindex[cp]
    endif
     
    //trend line
    DRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)
    DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)
     
    //support/resistance
    if showSR then
    DRAWHLINE(LTOPy) COLOURED(207,215,199,100)
    DRAWHLINE(LBOTy) COLOURED(207,215,199,100)
    endif
     
     
    barelapsedTOP=barindex-LTOPX
    barelapsedBOTTOM=barindex-LBOTX
     
    factorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)
    factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)
     
    //drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)
     
    nowTOP = LTOPy+(barelapsedTOP*factorTOP)
    drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)
     
    nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)
    drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)
     
    RETURN source as "indicator", nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)
    #181733 quote
    JJ Tec
    Participant
    Veteran

    Bonjour, Merci pour la réponse, je teste avec ce code d’un partenaire.
    Et j’aimerais savoir comment je pourrais faire un dépistage en petits groupes avec cet indicaur.
    Merci encore.

    //parthapersonal Fractals v1.2
    //PRT v11
    //By Vonasi
    //Date: 20201217
    
    defparam drawonlastbaronly = true
    //Settings
    BarsBefore = 3
    BarsAfter = 3
    Support = 3
    Resistance = 3
    Points = 3
    
    T=rsi[9](totalprice)
    
    //Make sure all settings are valid ones
    BarsBefore = max(BarsBefore,1)
    BarsAfter = max(BarsAfter,1)
    StartBack = max(0,startback)
    
    if barindex >= barsbefore + barsafter then
    
    //Look for a low fractal
    BarLookBack = BarsAfter + 1
    if t[BarsAfter] < lowest[BarsBefore](t)[BarLookBack] THEN
    if t[BarsAfter] = lowest[BarLookBack](t) THEN
    a = a + 1
    $supportbar[a] = barindex[barsafter]
    $supportvalue[a] = t[barsafter]
    endif
    endif
    
    //Look for a high fractal
    if t[BarsAfter] > highest[BarsBefore](t)[BarLookBack] THEN
    if t[BarsAfter] = highest[BarLookBack](t) THEN
    b = b + 1
    $resistancebar[b] = barindex[barsafter]
    $resistancevalue[b] = t[barsafter]
    endif
    endif
    
    if islastbarupdate then
    //support line
    if a >= 2 then
    if support then
    flag = 0
    zz = 0
    for z = a-zz downto 1
    for xx = 1 to a
    if z-xx < 1 then
    break
    endif
    if $supportvalue[z] > $supportvalue[z-xx] then
    drawsegment($supportbar[z-xx],$supportvalue[z-xx],$supportbar[z],$supportvalue[z],barindex+5) coloured(128,0,0)style(line,2)
    if points then
    drawpoint($supportbar[z],$supportvalue[z],2) coloured(128,0,0)
    drawpoint($supportbar[z-xx],$supportvalue[z-xx],2) coloured(128,0,0)
    endif
    flag = 1
    break
    endif
    zz = zz + 1
    next
    if flag = 1 then
    break
    endif
    zz = 0
    next
    endif
    endif
    
    //resistance line
    if b >= 2 then
    if resistance then
    flag = 0
    zz = 0
    for z = b-zz downto 1
    for xx = 1 to b
    if z-xx < 1 then
    break
    endif
    if $resistancevalue[z] < $resistancevalue[z-xx] then
    DRAWSEGMENT($resistancebar[z-xx],$resistancevalue[z-xx],$resistancebar[z],$resistancevalue[z],barindex+5) coloured(100,200,100)style(line,2)
    if points then
    drawpoint($resistancebar[z],$resistancevalue[z],2) coloured(0,128,0)
    drawpoint($resistancebar[z-xx],$resistancevalue[z-xx],2) coloured(0,128,0)
    endif
    flag = 1
    break
    endif
    zz = zz + 1
    next
    if flag = 1 then
    break
    endif
    zz = 0
    next
    endif
    endif
    
    endif
    endif
    
    return T as "r"
Viewing 11 posts - 91 through 101 (of 101 total)
  • You must be logged in to reply to this topic.

Trendline : Une approche du trading


Discussions générales sur le Trading

New Reply
Author
author-avatar
Sofitech @sofitech Participant
Summary

This topic contains 100 replies,
has 11 voices, and was last updated by JJ Tec
4 years, 2 months ago.

Topic Details
Forum: Discussions générales sur le Trading
Language: French
Started: 09/05/2016
Status: Active
Attachments: 24 files
Logo Logo
Loading...