Screener for Qtrend

Forums ProRealTime English forum ProScreener support Screener for Qtrend

  • This topic has 5 replies, 2 voices, and was last updated 4 weeks ago by avatarJS.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #240454

    Hi Nicolas,

    Pve the Q trend. Is it possible to built the screener for Q trend?

    The one which shows instruments with Green or Red triangle.

     

    Attached the Qtrend ITF

     

    Thanks

    Vineet

    #240455

    //PRC_Q-Trend | indicator
    //17.07.23
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge

    // —settings
    //p = 200 //Trend period
    //atrp = 14 //ATR Period
    //mult = 1.0 //ATR Multiplier
    //mode = 1 //Signal mode options = [1=”Type A”, 2=”Type B”]
    //useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
    //srcemaperiod = 3 //EMA Smoother period
    //colorbars = 0 //Color bars? 0=false ; 1=true
    //signalsview = 0 //0 = trend inversion ; 1 = strong buy / strong sell only
    // — end of settings

    source = customclose

    // Calculations
    if useemasmoother then
    src = average[srcemaperiod,1](source)
    else
    src=source
    endif

    hh = highest[p](src) // Highest of src p-bars back;
    ll = lowest[p](src) // Lowest of src p-bars back.
    d = hh – ll

    if barindex>p then
    once m = (hh + ll) / 2 // Initial trend line;
    atr = AverageTrueRange[atrp][1] // ATR;
    epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.

    if mode=2 then //type B
    changeup = src crosses over m+epsilon or src crosses under m+epsilon
    changedown = src crosses over m-epsilon or src crosses under m-epsilon
    else
    changeup = src crosses over m+epsilon or src > m+epsilon
    changedown = src crosses under m-epsilon or src < m-epsilon
    endif

    sb = open < ll + d / 8 and open >= ll
    ss = open > hh – d / 8 and open <= hh
    strongbuy = sb or sb[1] or sb[2] or sb[3] or sb[4]
    strongsell = ss or ss[1] or ss[2] or ss[3] or ss[4]

    if (changeup or changedown) then
    if changeup then
    m=m + epsilon
    elsif changedown then
    m=m – epsilon
    endif
    else
    m=m[1]
    endif

    if changeup then
    r=0
    g=255
    elsif changedown then
    r=255
    g=0
    endif

    if colorbars then
    drawcandle(open,high,low,close)coloured(r,g,0)
    endif

    if signalsview=1 then
    if strongbuy and ls<>1 then
    drawtext(“▲”,barindex,low) coloured(“lime”)
    ls=1
    endif
    if strongsell and ls<>-1 then
    drawtext(“▼”,barindex,high) coloured(“red”)
    ls=-1
    endif
    else
    if r<>r[1]and r>0 then
    drawtext(“▼”,barindex[1],m[1]) coloured(“red”)
    endif
    if r<>r[1]and r=0 then
    drawtext(“▲”,barindex[1],m[1]) coloured(“lime”)
    endif
    endif
    endif

    RETURN m style(line,3) coloured(r,g,0)

    #240457
    JS

    Hi,

    Did you check this one…

     

    2 users thanked author for this post.
    #240509

    thank you JS

    1 user thanked author for this post.
    avatar JS
    #240559

    This screener is great but it is only showing the bullish stock, is there any way I can see bearish stocks as well? I have the below selection for Q Trend Screener

     

     

    #240561
    JS

    For bullish and bearish stocks use: Screener[mysignal=1 or mysignal=-1]

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login