indicador RCI 3 lines

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #234269 quote
    AntuanAntuan
    Participant
    Senior

    buenas tardes…quiero poner este indicador para  prorealtime…ya  esta este mismo indicador en el    foro pero no  funciona..tiene que tener tres variables…os paso el codigo.

    //
    // @author Jadbrother modified by gero, optimized by yuza
    //
    //@version=3
    study(title = “RCI3lines optimized”, shorttitle = “RCI3lines opt”)

    itvs = input(9, “short interval”)
    itvm = input(26, “middle interval”)
    itvl = input(52, “long interval”)
    src = input(close, “source”)
    res = input(9, “resolution”, minval=9)
    upperband=input(title=”High line[%]”,defval=80,type=integer)
    lowerband=input(title=”Low line[%]”,defval=-80,type=integer)
    dmul = 600 / res / (res*res-1)

    ord(seq, idx, itv) =>
    p = seq[idx]
    o = 0.5
    for i = 0 to res-1
    d = (p – seq[i*itv])
    o := o + ((d<0) ? 1 : ((d==0) ? 0.5 : 0))
    o

    d(itv) =>
    sum = 0.0
    step = itv/res
    for i = 0 to res-1
    x = (i + 1) – ord(src, i*step, step)
    sum := sum + x*x
    sum

    rci(itv) => sma(100.0 – dmul * d(itv), ceil(itv/res))

    hline(upperband,color=gray,linestyle=dashed)
    hline(lowerband,color=gray,linestyle=dashed)
    plot(rci(itvs), title = “RCI short”, color = red)
    plot(rci(itvm), title = “RCI middle”, color = blue)
    plot(rci(itvl), title = “RCI long”, color = green)

     

     

    GRACIAS y a ver un valiente que llo saque….SR Nicolas

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

    Hola,

    Aquí tienes el código con las 3 líneas.

     

    //-------------------------------------------------------//
    //-----Inputs--------------------------------------------//
    itvs=9 //Short interval
    itvm=36 //Middle interval
    itvl=52 //Long interval
    src=close
    upperband=80 //High Line %
    lowerband=-80 //Low Line %
    //-------------------------------------------------------//
    //-----RCI Short Term------------------------------------//
    ditvs=0
    for i=0 to itvs-1 do
    
    psh=src[i]
    orditvs=1
    ssh=0
    for j=0 to itvs-1 do
    if psh<src[j] then
    orditvs=orditvs+1
    else
    if psh=src[j] then
    ssh=ssh+1
    orditvs=orditvs+(ssh-1)/2
    endif
    endif
    next
    
    ditvs=ditvs+pow((i+1)-orditvs,2)
    next
    
    RCIShort=(1-6*ditvs/(itvs*(itvs*itvs-1)))*100
    //-------------------------------------------------------//
    //-----RCI Middle Term---------------------------------------//
    ditvm=0
    for i=0 to itvm-1 do
    
    pmd=src[i]
    orditvm=1
    smd=0
    for j=0 to itvm-1 do
    if pmd<src[j] then
    orditvm=orditvm+1
    else
    if pmd=src[j] then
    smd=smd+1
    orditvm=orditvm+(smd-1)/2
    endif
    endif
    next
    
    ditvm=ditvm+pow((i+1)-orditvm,2)
    next
    
    RCIMiddle=(1-6*ditvm/(itvm*(itvm*itvm-1)))*100
    //-----RCI Long Term-------------------------------------//
    ditvl=0
    for i=0 to itvl-1 do
    
    plg=src[i]
    orditvl=1
    slg=0
    for j=0 to itvl-1 do
    if plg<src[j] then
    orditvl=orditvl+1
    else
    if plg=src[j] then
    slg=slg+1
    orditvl=orditvl+(slg-1)/2
    endif
    endif
    next
    
    ditvl=ditvl+pow((i+1)-orditvl,2)
    next
    
    RCILong=(1-6*ditvl/(itvl*(itvl*itvl-1)))*100
    //-------------------------------------------------------//
    return RCIShort as "RCI Short" coloured("red"), RCIMiddle as "RCI Middle"coloured("blue"), RCILong as "RCI Long"coloured("green"), upperband as "High Line %"style(dottedline), lowerband as "Low Line %" style(dottedline)
    EURUSD-Daily.png EURUSD-Daily.png
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

indicador RCI 3 lines


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
Antuan @osupero Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 06/23/2024
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...