screeners standard-deviation-channel

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #194032 quote
    lowbatlowbat
    Participant
    Senior

    Buongiorno

    sarebbe possibile creare uno screener che indichi le azioni che incrociano o toccano (o anche che siano in un range del 5 % )del canale inferiore o superiore del https://www.prorealcode.com/prorealtime-indicators/standard-deviation-standard-error-linear-regression-channel/?

    allego esempio grafico

     

    grazie

    2-1.png 2-1.png
    #194038 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    //PRC_Std and Ste LinRegChannel | indicator
    //Standard Deviation and Standard Error
    //Linear Regression Channel
    //12.03.2019
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //
    //defparam drawonlastbaronly=true
    //defparam calculateonlastbars=1000
    // --- settings
    lookback= 200 //channel period
    ChannelType = 1 //1= Standard Deviation ; 2= Standard Erro
    NbDeviation = 1 //Deviation multiplier
    //colorRed = 255
    //colorGreen = 255
    //colorBlue = 0
    // --- end of settings
    
    sumx = 0
    sumy = 0
    sumxy = 0
    sumx2 = 0
    
    for cmpt = lookback downto 0 do
    tmpx = cmpt
    tmpy = close[cmpt]
    sumy = sumy+tmpy
    sumx = sumx+tmpx
    sumx2 = sumx2 + (tmpx*tmpx)
    sumxy = sumxy + (tmpy*tmpx)
    next
    
    n = lookback+1
    
    if (sumx2 = sumx * sumx) then // protection to avoid infinite values
    b = sumxy - sumx * sumy
    else
    b = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)
    endif
    a = (sumy - b * sumx) / n
    
    //drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)
    
    //channel
    if ChannelType = 1 then //Standard Deviation
    dat = std[lookback]*NbDeviation
    else
    dat = ste[lookback]*NbDeviation
    endif
    //drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)
    //drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)
    
    UPPERline1  = (a+dat) * 1.05      //+5%
    UPPERline2  = (a+dat) * 0.95      //-5%
    LOWERline1  = (a-dat) * 1.05      //+5%
    LOWERline2  = (a-dat) * 0.95      //-5%
    
    Cond = 0
    IF close >= UPPERline2 AND close <= UPPERline1 THEN
    Cond = 1
    ELSIF close >= LOWERline2 AND close <= LOWERline1 THEN
    Cond = 2
    ENDIF
    
    SCREENER[Cond](Cond AS "1=↑,2=↓")
    Il-Mio-ProScreener12.itf
    #194040 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ovviamente i periodi non possono superare 250 (anche se puoi arrivare a 254 se vuoi, oppure 1024 con la versione Premium di PRT).

    #194211 quote
    lowbatlowbat
    Participant
    Senior

    grazie è perfetto…!!!!!

    robertogozzi thanked this post
Viewing 4 posts - 1 through 4 (of 4 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

screeners standard-deviation-channel


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
lowbat @lowbat Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by lowbatlowbat
4 years, 3 months ago.

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 05/28/2022
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...