Indicatore PRC RANGE_DETECTOR

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #243717 quote
    Ciccarelli FrancoCiccarelli Franco
    Participant
    Senior

    Buongiorno Ivan

    è possibile trasformare in scrinner l’indicatore in oggetto?

    Grazie

    #243723 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ciao. Ecco qui:

    //------------------------------------------------------------------------//
    //PRC_Range Detector
    //version = 0
    //09.04.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //------------------------------------------------------------------------//
    //-----Inputs-------------------------------------------------------------//
    length=20//Minimum Range Length
    mult=1//Range Width
    atrLen=500//ATR Length
    //------------------------------------------------------------------------//
    //-----Moving average and ATR definition----------------------------------//
    n=barindex
    atr=averagetruerange[atrlen](close)*mult
    ma=average[length,0](close)
    //-----Check range--------------------------------------------------------//
    count=0
    for j=0 to length-1 do
    if abs(close[j]-ma) > atr then
    count=count+1
    else
    count=count
    endif
    next
    //-----Box definition-----------------------------------------------------//
    if count=0 and count[1]<>count then
    //Test for overlap and change coordinates
    if n[length] <= $boxright[x] then
    maxi = max(ma+atr,$boxtop[x])
    mini = min(ma-atr,$boxbot[x])
    //Box new coordinates
    $boxtop[x]=maxi
    $boxbot[x]=mini
    $boxright[x]=n
    //Line new coordinates
    avg=(maxi+mini)/2
    $levely1[x]=avg
    $levelx2[x]=n
    $levely2[x]=avg
    //backgroundcolor("Blue",50)
    rangedetected=1
    //newrange=0
    else
    maxi=ma+atr
    mini=ma-atr
    //Set new box
    $boxtop[x+1]=maxi
    $boxbot[x+1]=mini
    $boxright[x+1]=n
    $boxleft[x+1]=n[length]
    //Set new level
    $levely1[x+1]=ma
    $levelx2[x+1]=n
    $levely2[x+1]=ma
    $levelx1[x+1]=n[length]
    //Set color
    $rbox[x+1]=33
    $gbox[x+1]=87
    $bbox[x+1]=243
    //Highligth first occurrence
    //backgroundcolor("grey",50)
    $start[x+1]=n
    //Set new value for x
    x=x+1
    rangedetected=1
    //newrange=1
    endif
    //elsif count=0 then
    ////Extend the box
    //$boxright[x]=n
    //$levelx2[x]=n
    //rangedetected=1
    //newrange=0
    else
    rangedetected=0
    endif
    //------------------------------------------------------------------------//
    SCREENER[rangedetected and close<$boxtop[x] and close>$boxbot[x]]
    
Viewing 2 posts - 1 through 2 (of 2 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

Indicatore PRC RANGE_DETECTOR


ProScreener: Scansione Mercati & Screener

New Reply
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
1 year, 7 months ago.

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 02/11/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...