Trendline : Une approche du trading

Viewing 15 posts - 76 through 90 (of 101 total)
  • Author
    Posts
  • #178676 quote
    Manu L.
    Participant
    Average

    ANNULE ET REMPLACE

    Perfect Trend Line 2 , je l’ai déjà 🙂

     

    Lors de l’un de mes précédents post,  j’ai mélangé Perfect Trend Line et Fractals Trend Line : désolé 🙁 . Je parle bien de l’indicateur Fractals Trend Line.

    Mon pb concerne bien le Fractal Trend Line : les escaliers tracés en partie supérieure (Fractals Trend line) et inférieure (Fractals trend Line 2) avec un remplissage bleu correspondent de mémoire aux différents supports et résistances antérieures.

    #178677 quote
    Manu L.
    Participant
    Average

    Bon ben c’est quand on cherche on trouve : en page 3 🙂

    “Si tu souhaites récupérer les valeurs des lignes de support et resistance dynamique de l’indicateur trendline, tu n’as qu’à changer la dernière ligne comme ceci:

    Tu pourras ainsi ensuite faire un CALL de l’indicateur et récupérer ces deux valeurs.”

    Désolé cette perte de tps 🙁

    #178678 quote
    Manu L.
    Participant
    Average

    Concernant l’indicateur initial “Fractals Trend Line”, est-il possible de créer un screenner valable sur tous les UT qui permet de détecter :

    • un croisement des Trend Lines obliques
    • une ouverture ou mèche la plus basse sur la Trend Line oblique  inférieure (flag orange)
    • une clôture ou mèche la plus haute sur la Trend Line oblique supérieure (flag gris)
    • une ouverture ou mèche la plus basse sur le support Trend Line horizontale supérieure (flag vert)
    • une clôture ou mèche la plus haute sur la résistance Trend Line horizontale inférieure (flag rouge)

    J’ai voulu créer ce screener en CALL mais impossible d’avoir ces données en sélection d’ou le passage par une programmation et l’ideal serait d’ajouter un flag (voir fin de ligne scénario) ou une numérotation dans le champ zone de la liste.

    Si tu le souhaites, je peux décrire les différents scénarios pas copies d’écran.

    Merci pour ton aide

    #179893 quote
    Manu L.
    Participant
    Average

    Une peu d’aide sur mon screnner, merci

    #179897 quote
    Nicolas
    Keymaster
    Master

    Cette version de l’indicateur des fractals trend line renvoi la valeur en temps réel des lignes, donc on peut l’utiliser en CALL pour tester un croisement avec par exemple:

    defparam drawonlastbaronly = true
    defparam calculateonlastbars = 500
    
    //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(0,0,0,0), nowBOTTOM coloured(0,0,0,0)
    
    JJ Tec thanked this post
    #179945 quote
    JJ Tec
    Participant
    Veteran

    Salut, Merci pour le travail. Je voulais demander comment nous ferions le dépistage pour détecter la rupture d’une ligne directrice ?

    #179961 quote
    Nicolas
    Keymaster
    Master

    Avec une detection de croisement par exemple: CROSSES OVER / CROSSES UNDER

    JJ Tec thanked this post
    #180013 quote
    JJ Tec
    Participant
    Veteran

    Salut, quand je charge l’indicateur il me demande de définir “ShowSR” Pourriez-vous m’aider?

    #180015 quote
    Nicolas
    Keymaster
    Master
    ajouter en début de code soit: showSR=0 //ne pas afficher les supports / resistances ou showSR = 1 //afficher les supports / resistances
    #180039 quote
    JJ Tec
    Participant
    Veteran
    Excusez moi mais je ne sais toujours pas comment faire Je ne sais pas faire le screener pour détecter le croisement
    #180049 quote
    Nicolas
    Keymaster
    Master
    Très bien, le code du screener ci-dessous détecte les cassures de triangle :
    lookback = 10
    
    //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
    
    barelapsedTOP=barindex-LTOPX
    barelapsedBOTTOM=barindex-LBOTX
    
    factorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)
    factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)
    
    nowTOP = LTOPy+(barelapsedTOP*factorTOP)
    
    nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)
    
    breakout = (close crosses over nowtop or close crosses under nowbottom) and nowtop<nowtop[1] and nowbottom>nowbottom[1] and nowtop>nowbottom
    
    screener[breakout]
    JJ Tec thanked this post
    #180070 quote
    supertiti
    Participant
    Master
    Bonjour Nicolas, Est il possible de fabriquer le même screener de sorties de triangle avec le code de Swapping ?
    // Swapping Trendline area 3
    
    //PRC_TrendLine_Area | Indicator 16.01.2019 (release 1.3)
    //Nicolas @ www.prorealcode.com
    // ( Modification du code "PRC_Quick Fib" afin de visualiser les lignes de tendances obliques ou leurs segments avec réglage de l'épaisseur des traits et les zones support ou resistance
    
    
    // AJOUT de style(line,3) aux segments et lignes dans la version 3
    
    Defparam calculateonlastbars = 100
    DefParam DrawOnLastBarOnly = true
    
    // --- property settings
    //Period    = 150 perso = 100 // Lookback period of the Fibonacci Retracement
    //TrendLine = 0   // (0= Segment, 1= Trend Line)                 
    //Fibonacci = 0   // (0= Empty, 1= Fibonacci)                       
    //Invert    = 0   // (0= Fibo normal, 1= Fibo invert)            
    //Area      = 0   // (0= Empty, 1= Rectangle)                   
    //Thickness = 2   // Thickness Area rectangle (default 2)    
    // --- end of settings
    
    hh = 0
    ll = low
    
    shiftlowest = barindex
    for i = period downto 1 do
    if high[i]>hh then
    hh = high[i]
    shifthighest = barindex[i]
    endif
    if low[i]<ll then
    ll = low[i]
    shiftlowest = barindex[i]
    endif
    next
    
    isSwingDown = shiftHighest < shiftLowest
    
    if isSwingDown then
    fullrange = abs(hh-ll)
    fibo100   = hh
    fibo0     = ll
    fibo236   = ll+(fullrange*0.236)
    fibo382   = ll+(fullrange*0.382)
    fibo50    = ll+fullrange/2
    fibo618   = ll+(fullrange*0.618)
    fibo764   = ll+(fullrange*0.764)
    startbar  = min(shifthighest,shiftlowest)
    r = 255 // Orange  // rouge 200
    g = 136 // Orange  // rouge 0
    b = 0              // rouge 0
    DrawText("HI #hh#",shifthighest,hh+fullrange*0.03,dialog,standard,10) coloured(r,g,b) // plot price at 0% and 100% levels
    DrawText("LO #ll#",shiftlowest,ll-fullrange*0.03,dialog,standard,10) coloured(r,g,b)
    else
    fullrange = abs(hh-ll)
    fibo100   = ll
    fibo0     = hh
    fibo236   = hh-(fullrange*0.236)
    fibo382   = hh-(fullrange*0.382)
    fibo50    = hh-fullrange/2
    fibo618   = hh-(fullrange*0.618)
    fibo764   = hh-(fullrange*0.764)
    startbar  = min(shifthighest,shiftlowest)
    r = 247 // Jaune // vert 0
    g = 255 // Jaune // vert 200
    b = 0   // Jaune // vert 0
    DrawText("HI #hh#",shifthighest,hh+fullrange*0.03,dialog,standard,10) coloured(r,g,b) // plot price at 0% and 100% levels
    DrawText("LO #ll#",shiftlowest,ll-fullrange*0.03,dialog,standard,10) coloured(r,g,b)
    endif
    
    if Fibonacci = 1 and invert = 0 then // plot fibonacci levels
    DrawSegment(startbar,fibo0,barindex,fibo0) coloured(r,g,b)style (line,3)
    DrawText("                0%",barindex,fibo0,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo236,barindex,fibo236) coloured(r,g,b)style (line,3)
    DrawText("                    23.6%",barindex,fibo236,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo382,barindex,fibo382) coloured(r,g,b)style (line,3)
    DrawText("                    38.2%",barindex,fibo382,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo50,barindex,fibo50) coloured(r,g,b)style (line,3)
    DrawText("                    50.0%",barindex,fibo50,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo618,barindex,fibo618) coloured(r,g,b)style (line,3)
    DrawText("                    61.8%",barindex,fibo618,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo764,barindex,fibo764) coloured(r,g,b)style (line,3)
    DrawText("                    76.4%",barindex,fibo764,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo100,barindex,fibo100) coloured(r,g,b)style (line,3)
    DrawText("                  100%",barindex,fibo100,Dialog,Standard,20) coloured(r,g,b)
    elsif Fibonacci = 1 and invert = 1 then // plot invert fibonacci levels
    DrawSegment(startbar,fibo0,barindex,fibo0) coloured(r,g,b)style (line,3)
    DrawText("               100%",barindex,fibo0,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo236,barindex,fibo236) coloured(r,g,b)style (line,3)
    DrawText("                    76.4%",barindex,fibo236,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo382,barindex,fibo382) coloured(r,g,b)style (line,3)
    DrawText("                    61.8%",barindex,fibo382,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo50,barindex,fibo50) coloured(r,g,b)style (line,3)
    DrawText("                    50.0%",barindex,fibo50,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo618,barindex,fibo618) coloured(r,g,b)style (line,3)
    DrawText("                    38.2%",barindex,fibo618,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo764,barindex,fibo764) coloured(r,g,b)style (line,3)
    DrawText("                    23.6%",barindex,fibo764,Dialog,Standard,20) coloured(r,g,b)
    DrawSegment(startbar,fibo100,barindex,fibo100) coloured(r,g,b)style (line,3)
    DrawText("                    0%",barindex,fibo100,Dialog,Standard,20) coloured(r,g,b)
    endif
    
    // contour lines
    shiftContourDown = barindex-shiftHighest
    highestSlope = 0
    counth = max(1,(barindex-shifthighest))
    for i = 2 to counth do
    thisSlope = (high[i] - hh) / ((barindex-shiftHighest) - i)
    if (thisSlope >= highestSlope or highestSlope = 0) then
    shiftContourDown = i
    highestSlope = thisSlope
    endif
    next
    shiftContourUp = barindex-shiftLowest
    LowestSlope = 0
    countl = max(1,(barindex-shiftLowest))
    for i = 2 to countl do
    thisSlope = (low[i] - ll) / ((barindex-shiftLowest) - i)
    if (thisSlope <= LowestSlope or LowestSlope = 0) then
    shiftContourUp = i
    LowestSlope = thisSlope
    endif
    next
    
    // retracement blocks
    if Area then
    if isSwingDown then
    blockprice = hh
    startbar = barindex-shifthighest
    for i = startbar downto 2 do
    if low[i]<blockprice then
    blockprice = low[i]
    blockbar = barindex[i]
    endif
    next
    //DrawRectangle(blockbar,blockprice,barindex,ll) coloured(r,g,b)  // program init with box "DrawRectangleBlocks"
    DrawRectangle(shifthighest,blockprice-(thickness),barindex,ll+(thickness)) coloured(r,g,b) // Option Zone with Thickness
    else
    blockprice = ll
    startbar = barindex-shiftlowest
    for i = startbar downto 2 do
    if high[i]>blockprice then
    blockprice = high[i]
    blockbar = barindex[i]
    endif
    next
    //DrawRectangle(blockbar,blockprice,barindex,hh) coloured(r,g,b)  // program init with box "DrawRectangleBlocks"
    DrawRectangle(blockbar+60,blockprice-(thickness),shiftlowest,hh+(thickness)) coloured(r,g,b) // Option Zone with Thickness
    endif
    endif
    
    if TrendLine = 0 then
    DrawSegment(shifthighest,hh,barindex[shiftcontourdown],high[shiftcontourdown]) coloured(r,g,b) style (line,3)                    // only Segment
    DrawSegment(shiftlowest,ll,barindex[shiftcontourup],low[shiftcontourup]) coloured(r,g,b)  style (line,3)                           // only Segment
    elsif TrendLine = 1 and Invert = 0 then
    DrawLine(shifthighest,hh,barindex[shiftcontourdown],high[shiftcontourdown]) coloured(r,g,b)     style (line,3)                     // program init
    DrawLine(shiftlowest,ll+(thickness),barindex[shiftcontourup],low[shiftcontourup]+(thickness)) coloured(r,g,b)  style (line,3)      // add double shiftlowest inside
    DrawLine(shiftlowest,ll,barindex[shiftcontourup],low[shiftcontourup]) coloured(r,g,b)  style (line,3)                              // program init
    DrawLine(shifthighest,hh-(thickness),barindex[shiftcontourdown],high[shiftcontourdown]-(thickness)) coloured(r,g,b) style (line,3) // add double shifthighwest inside
    else
    DrawLine(shifthighest,hh,barindex[shiftcontourdown],high[shiftcontourdown]) coloured(r,g,b)       style (line,3)                   // program init
    DrawLine(shiftlowest,ll-(thickness),barindex[shiftcontourup],low[shiftcontourup]-(thickness)) coloured(r,g,b) style (line,3)       // add double shifthilowest outside
    DrawLine(shiftlowest,ll,barindex[shiftcontourup],low[shiftcontourup]) coloured(r,g,b)   style (line,3)                             // program init
    DrawLine(shifthighest,hh+(thickness),barindex[shiftcontourdown],high[shiftcontourdown]+(thickness)) coloured(r,g,b)style (line,3)  // add double shifthighest outside
    
    endif
    
    return
    
    #180072 quote
    Nicolas
    Keymaster
    Master
    Ci-dessous le code du screener pour détecter les breakout de trendline avec ce dernier code:
    // Swapping Trendline area 3
    
    //PRC_TrendLine_Area | Indicator 16.01.2019 (release 1.3)
    //Nicolas @ www.prorealcode.com
    // ( Modification du code "PRC_Quick Fib" afin de visualiser les lignes de tendances obliques ou leurs segments avec réglage de l'épaisseur des traits et les zones support ou resistance
    
    
    // AJOUT de style(line,3) aux segments et lignes dans la version 3
    
    // --- property settings
    Period    = 50 //perso = 100 // Lookback period of the Fibonacci Retracement
    // --- end of settings
    
    hh = 0
    ll = low
    
    shiftlowest = barindex
    for i = period downto 1 do
    if high[i]>hh then
    hh = high[i]
    shifthighest = barindex[i]
    endif
    if low[i]<ll then
    ll = low[i]
    shiftlowest = barindex[i]
    endif
    next
    
    // contour lines
    shiftContourDown = max(1,barindex-shiftHighest)
    highestSlope = 0
    counth = max(1,(barindex-shifthighest))
    for i = 2 to counth do
    thisSlope = (high[i] - hh) / ((barindex-shiftHighest) - i)
    if (thisSlope >= highestSlope or highestSlope = 0) then
    shiftContourDown = i
    highestSlope = thisSlope
    endif
    next
    shiftContourUp = max(1,barindex-shiftLowest)
    LowestSlope = 0
    countl = max(1,(barindex-shiftLowest))
    for i = 2 to countl do
    thisSlope = (low[i] - ll) / ((barindex-shiftLowest) - i)
    if (thisSlope <= LowestSlope or LowestSlope = 0) then
    shiftContourUp = i
    LowestSlope = thisSlope
    endif
    next
    
    barelapsedTOP=barindex-shifthighest
    barelapsedBOTTOM=barindex-shiftlowest
    
    factorTOP = (hh-high[shiftcontourdown])/(barindex[shiftcontourdown]-shifthighest)
    factorBOTTOM = (low[shiftcontourup]-ll)/(barindex[shiftcontourup]-shiftlowest)
    
    nowTOP = hh-(barelapsedTOP*factorTOP)
    nowBOTTOM = ll+(barelapsedBOTTOM*factorBOTTOM)
    
    breakout = close crosses over nowtop or close crosses under nowbottom
    
    screener[breakout]
    
    
    JJ Tec thanked this post
    #180083 quote
    supertiti
    Participant
    Master
    Service express et de qualité j’en suis sûr merci Nicolas pour ta réactivité et disponibilité Bonne après midi
    #180612 quote
    Manu L.
    Participant
    Average
    merci Nicolas pour ce code et j’ai pu créer le screener.
Viewing 15 posts - 76 through 90 (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...