Adaptive ATR-ADX Trend-V2 screener

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #78107 quote
    groen200groen200
    Participant
    Veteran

    I need some help to make a proscreener from this indicator. Thank you.

    #78208 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This is the screener, but it returns a price to be used a SL, is that what you want?

    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)")
    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
    else
    sstop=TDown
    endif
    screener [sstop] (sstop AS "sstop")
    #78285 quote
    groen200groen200
    Participant
    Veteran

    Roberto

    a screener crossing the ATR-ADX TREND V2 and the price typical: (H+L+C)/3

    only the latest crossing max 2 days

    #78286 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go, but this one will display only the current crossings (I’ll change it later if it’s ok so far):

    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)")
    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
    else
    sstop=TDown
    endif
    x = sstop CROSSES OVER  TypicalPrice OR sstop CROSSES UNDER TypicalPrice
    screener [x] (sstop AS "sstop")
    #78434 quote
    groen200groen200
    Participant
    Veteran

    Hi Roberto

    i hope you can help me.

    tks luc

    #78438 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I helped you, I’m waiting for your answer!

    #78440 quote
    groen200groen200
    Participant
    Veteran

    Which answer exactily do you need?

    #78459 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    #78463 quote
    groen200groen200
    Participant
    Veteran

    Hi Roberto

    Verry, verry thanks for this beautifull screener

    I hope its make me a little money, afther 12 jears loss!!!

    thanks

    Luc

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Adaptive ATR-ADX Trend-V2 screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
groen200 @groen200 Participant
Summary

This topic contains 8 replies,
has 2 voices, and was last updated by groen200groen200
8 years, 1 month ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 08/14/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...