screener avec ATR ADX Trend & Supertrend Extended

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #142239 quote
    finplus
    Participant
    Master

    Bonsoir, j’aimerai (car je n’arrive pas à le faire moi-même) un screener intégrant ces deux codes qui détecterait :

    – condition 1 = le franchissement à la hausse de l’ATR ADX Trend par les prix lorsque (condition 2) le Supertrend Extended est haussier (soit la ligne Supertrend Extended 2 au dessus de la ligne Supertrend Extended 1)

    – condition 3= le franchissement à la baisse de l’ATR ADX Trend par les prix lorsque (condition 4) le Supertrend Extended est baissier (soit la ligne Supertrend Extended 2 au dessous de la ligne Supertrend Extended 1).

    Merci d’avance pour votre aide sur ce sujet.

    ////_Adaptive-ATR-ADX-Trend-V2 | indicator
    //29.06.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from tradingview code
    
    // --- settings
    atrLen = 21
    m1 = 3.5 //"ATR Multiplier - ADX Rising"
    m2 = 1.75 //"ATR Multiplier - ADX Falling"
    adxLen = 14
    adxThresh = 30 //"ADX Threshold"
    aboveThresh = 1 //true, title = "ADX Above Threshold uses ATR Falling Multiplier Even if Rising?")
    useHeiken = 1 //(false, title = "Use Heiken-Ashi Bars (Source will be ohlc4)")
    // --- end of settings
    
    source = MedianPrice
        
    // DI-Pos, DI-Neg, ADX
    
    hR = high-high[1]
    lR = -(low-low[1])
    
    if hr>lr then
    dmPos=max(hr,0)
    else
    dmPos=0
    endif
    if lr>hr then
    dmNeg=max(lr,0)
    else
    dmNeg=0
    endif
    
    sTR = (sTR[1] - sTR[1]) / adxLen + tr
    
    sDMPos = (sDMPos[1] - sDMPos[1]) / adxLen + dmPos
    sDMNeg = (sDMNeg[1] - sDMNeg[1]) / adxLen + dmNeg
    
    DIP = sDMPos / sTR * 100
    DIN = sDMNeg / sTR * 100
    DX = abs(DIP - DIN) / (DIP + DIN) * 100
    aadx = average[adxLen](DX)
    
    // Heiken-Ashi
    
    if barindex<2 then
    xClose = close
    xOpen = open
    else
    xClose = TotalPrice
    xOpen = (xOpen[1] + close[1]) / 2
    endif
    xHigh = max(high, max(xOpen, xClose))
    xLow = min(low, min(xOpen, xClose))
    
    // Trailing ATR
    
    v1 = abs(xHigh - xClose[1])
    v2 = abs(xLow - xClose[1])
    v3 = xHigh - xLow
    
    trueRange = max(v1, max(v2, v3))
    if useHeiken then
    atr = WilderAverage[atrLen](trueRange)
    else
    atr = AverageTrueRange[atrLen]
    endif
    
    if aadx>aadx[1] and (adx < adxThresh or not aboveThresh) then
    m=m1
    elsif aadx<aadx[1] or (adx > adxThresh and aboveThresh) then
    m=m2
    else
    m = m[1]
    endif
    
    if DIP >= DIN then
    mUp=m
    else
    mUp=m2
    endif
    if DIN >= DIP then
    mDn=m
    else
    mDn=m2
    endif
    
    if useHeiken then
    src=xClose
    c=Xclose
    t=(xHigh+xLow)/2
    else
    src=source
    c=close
    t=MedianPrice
    endif
    
    up = t - mUp * atr
    dn = t + mDn * atr
    
    if max(src[1], c[1]) > TUp[1] then
    TUp = max(up,TUp[1])
    else
    TUp = up
    endif
    
    if min(src[1], c[1]) < TDown[1] then
    TDown = min(dn, TDown[1])
    else
    TDown = dn
    endif
    
    //trend
    if min(src,min(c,close))>TDown[1] then
    trend=1
    elsif max(src,max(c,close))<TUp[1] then
    trend=-1
    else
    trend=trend[1]
    endif
    
    if trend=1 then
    sstop=TUp
    r=0
    g=255
    else
    sstop=TDown
    r=255
    g=153
    endif
    
    if trend<>trend[1] then
    drawtext("•",barindex,sstop,Dialog,Standard,30) coloured(r,g,0)
    endif
    
    return sstop coloured(r,g,0) style(line,4)
    //// PRC_SuperTrend Extended | indicator
    //31.10.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    multiplier=2.236
    period=66
    //type=1 //1 = use ATR , 2 = Use standard deviation , 3 = Use standard error
    midperiod=10
    // --- end of settings
    
    type=max(1,type)
    if type=1 then
    moy=averagetruerange[period](close)
    elsif type=2 then
    moy=std[period](close)
    elsif type=3 then
    moy=ste[period](close)
    endif
    
    price=(highest[midperiod](high)+lowest[midperiod](low))/2
    up=price+multiplier*moy
    dn=price-multiplier*moy
    once trend=1
    if close>up[1] then
    trend=1
    elsif close<dn[1] then
    trend=-1
    endif
    if trend<0 and trend[1]>0 then
    flag=1
    else
    flag=0
    endif
    if trend>0 and trend[1]<0 then
    flagh=1
    else
    flagh=0
    endif
    if trend>0 and dn<dn[1] then
    dn=dn[1]
    endif
    if trend<0 and up>up[1] then
    up=up[1]
    endif
    if flag=1 then
    up=price+multiplier*moy
    endif
    if flagh=1 then
    dn=price-multiplier*moy
    endif
    if trend=1 then
    mysupertrend=dn
    offset=moy
    color1=0
    color2=191
    color3=255
    else
    mysupertrend=up
    offset=-moy
    color1=255
    color2=165
    color3=0
    endif
    
    indicator113 = CALL "KAMA 50"[50, 2, 30]
    indicator115 = CALL "KAMA 200"[200, 2, 30]
    
    c112a = (indicator113 > indicator113[1])
    c113a = (indicator115 > indicator115[1])
    
    c121a = (indicator113 < indicator113[1])
    c131a = (indicator115 < indicator115[1])
    
    KAMAUP = c112a and c113a
    KAMADn = c121a and c131a
    
    if trend=1 and trend[1]<>1 and kamaup then
    drawarrowup(barindex,mysupertrend) coloured(color1,color2,color3)
    endif
    if trend=-1 and trend[1]<>-1 and kamadn then
    drawarrowdown(barindex,mysupertrend) coloured(color1,color2,color3)
    endif
    
    return mysupertrend coloured (color1,color2,color3) as "SuperTrend Extended 1", mysupertrend+offset coloured (color1,color2,color3) as "SuperTrend Extended 2"
    #143787 quote
    finplus
    Participant
    Master

    Bonsoir, je me permets de remonter ma demande. merci.

    #143921 quote
    Nicolas
    Keymaster
    Master

    Toutes les infos nécessaires sont retournées par les indicateurs, possible avec la création assistée je pense, as-tu essayé ?

    #143922 quote
    finplus
    Participant
    Master

    oui et je n’y arrive pas car je ne parviens pas à distinguer pour l’ATR la formule du trend et pour le supertrend la formule des 2 supertrend. C’est pour cela que j’en appelle à vous.

    #143947 quote
    finplus
    Participant
    Master

    Et j’ai des retours qui ne correspondent pas à la réalité de la situation.

    #143948 quote
    finplus
    Participant
    Master
    ignored, indicator1 = CALL "Supertrend Extended"
    indicator2, ignored = CALL "Supertrend Extended"
    c1 = (indicator1 > indicator2)
    
    indicator3 = CALL "ATR ADX Trend"(close)
    c2 = (close CROSSES OVER indicator3)
    
    ignored, indicator4 = CALL "Supertrend Extended"
    indicator5, ignored = CALL "Supertrend Extended"
    c3 = (indicator4 < indicator5)
    
    indicator6 = CALL "ATR ADX Trend"(close)
    c4 = (close CROSSES UNDER indicator6)
    
    
    SCREENER[(c1 AND c2) OR (c3 AND c4)] ((close/DClose(1)-1)*100 AS "% Veille")

    Voilà le screener réalisé avec l’assistant. Il ne fonctionne pas correctement. Sur le change il renvoie des informations erronées. Par contre il fonctionne correctement sur le brent.

    #144693 quote
    finplus
    Participant
    Master

    Bonsoir, je le remonte pour info : une petite aide serait appréciable. Merci et bon week-end.

    #145998 quote
    finplus
    Participant
    Master

    Rebonsoir,

    je remonte ma demande de screener. Car je n’y arrive pas.

    Une petite aide serait appréciable.

    merci.

    #146093 quote
    Nicolas
    Keymaster
    Master

    Merci de fournir les fichiers de KAMA 50 et KAMA 200, ces 2 indicateurs sont appelés dans un des codes.

    #146121 quote
    finplus
    Participant
    Master
    // parameters :
    Period = 50
    FastPeriod = 2
    SlowPeriod = 30
     
    Fastest = 2 / (FastPeriod + 1)
    Slowest = 2 / (SlowPeriod + 1)
    if barindex < Period+1 then
    Kama=close
    else
    Num = abs(close-close[Period])
    Den = summation[Period](abs(close-close[1]))
    ER = Num / Den
    Alpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)
    KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])
    endif
     
    return kama
    // parameters :
    Period = 200
    FastPeriod = 2
    SlowPeriod = 30
     
    Fastest = 2 / (FastPeriod + 1)
    Slowest = 2 / (SlowPeriod + 1)
    if barindex < Period+1 then
    Kama=close
    else
    Num = abs(close-close[Period])
    Den = summation[Period](abs(close-close[1]))
    ER = Num / Den
    Alpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)
    KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])
    endif
     
    return kama

    Merci.

    #146596 quote
    finplus
    Participant
    Master

    Bonsoir, je me permets de remonter ma demande. merci pour votre aide sur ce sujet.

    #146634 quote
    Nicolas
    Keymaster
    Master

    Le plus simple serait d’exporter le fichier itf du screener, celui-ci embarquera automatiquement tous les codes nécessaires. Sinon je vais devoir créer tous les fichiers moi mêmes avec les codes éparpillés dans ce sujet 🙄 Merci !

    #146691 quote
    finplus
    Participant
    Master

    Quel fichier itf du screener ? Je n’ai pas de screener justement et c’était l’objet de ma demande initiale.

    #146727 quote
    Nicolas
    Keymaster
    Master

    Le screener de ce post: https://www.prorealcode.com/topic/screener-avec-atr-adx-trend-supertrend-extended/#post-143948

    il faut exporter le fichier itf et l’ajouter à ton prochain message. Je pourrais ainsi récupérer l’ensemble des fichiers que tu utilises en un instant et dans la même configuration que la tienne, merci.

    #146774 quote
    finplus
    Participant
    Master

    Bon, j’ai compris. Sauf que le screener en question ne fonctionnait pas. Je l’avais réalisé avec l’assistant de programmation mais comme il me renvoyait des informations erronées, je l’ai supprimé. Si cela vous arrange, je peux le refaire.

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

screener avec ATR ADX Trend & Supertrend Extended


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 19 replies,
has 2 voices, and was last updated by finplus
5 years, 4 months ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 08/21/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...