Conversión Doble Techo/Suelo

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #242470 quote
    MaricarmenMaricarmen
    Participant
    Veteran
    Buenas: Paso indicador de Tradingview para su conversión a ProRealTime,  si es posible.

    Double Top/Bottom [AlgoAlpha]

    Muchas gracias,
    #242554 quote
    Iván GonzálezIván González
    Moderator
    Legend
    Buenas tardes. No hay ninguna captura de pantalla mostrando ejemplos del indicador ni tampoco el código de éste. Me temo que no te podré ayudar así…
    #242579 quote
    MaricarmenMaricarmen
    Participant
    Veteran
    Adjunto archivo
    Double-Top-Bottom.jpg Double-Top-Bottom.jpg
    #243155 quote
    Iván GonzálezIván González
    Moderator
    Legend
    Buenas. Aquí lo tienes:
    //----------------------------------------------------------//
    //----------------------------------------------------------//
    // inputs
    //----------------------------------------------------------//
    x=21 // time horizon
    src=close
    onlysignals=0
    //----------------------------------------------------------//
    
    //----------------------------------------------------------//
    limit1=average[100](abs(open-close))
    //Pivots low
    if src > src[x] and lowest[x](src) > src[x] and src[x] < lowest[x](src)[x+1] then
    $pivoty[n+1] = src[x]
    $pivotx[n+1] = barindex[x]
    $pivotdir[n+1] = -1
    //drawpoint(barindex[x],src[x],2)coloured("red",180)
    n=n+1
    endif
    //Pivots high
    if src < src[x] and highest[x](src)<src[x] and src[x]>highest[x](src)[x+1] then
    $pivoty[n+1] = src[x]
    $pivotx[n+1] = barindex[x]
    $pivotdir[n+1] = 1
    //drawpoint(barindex[x],src[x],2)coloured("blue",180)
    n=n+1
    
    endif
    //----------------------------------------------------------//
    // Limit
    //----------------------------------------------------------//
    limit1=average[100](abs(open-close))
    //----------------------------------------------------------//
    //
    //----------------------------------------------------------//
    if n>3 then
    
    if n<>n[1] and $pivotdir[n]<0 and $pivotdir[n-1]>0 and $pivotdir[n-2]<0 and $pivotdir[n-3]>0  and abs(close[x]-$pivoty[n-2])<limit1  then
    
    trigger=$pivoty[n]
    drawarrowup($pivotx[n],$pivoty[n])coloured("green")
    if onlysignals=0 then
    drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n],$pivoty[n])coloured("green")
    drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n-2],$pivoty[n-2])coloured("green")
    drawsegment($pivotx[n-3],$pivoty[n-3],$pivotx[n-2],$pivoty[n-2])coloured("green")
    endif
    awaitingDBC=1
    Bthresh=$pivoty[n-1]
    Bthreshidx=$pivotx[n-1]
    
    endif
    
    if n<>n[1] and $pivotdir[n]>0 and $pivotdir[n-1]<0 and $pivotdir[n-2]>0 and$pivotdir[n-3]<0 and abs(close[x]-$pivoty[n-2])<limit1 then
    
    trigger=$pivoty[n]
    drawarrowdown($pivotx[n],$pivoty[n])coloured("red")
    if onlysignals=0 then
    drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n],$pivoty[n])coloured("red")
    drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n-2],$pivoty[n-2])coloured("red")
    drawsegment($pivotx[n-3],$pivoty[n-3],$pivotx[n-2],$pivoty[n-2])coloured("red")
    endif
    awaitingDTC=1
    Tthresh=$pivoty[n-1]
    Tthreshidx=$pivotx[n-1]
    
    endif
    endif
    
    if awaitingDBC and onlysignals=0 then
    barsDBC=barsDBC+1
    if close < bthresh and barsDBC>x then
    awaitingDBC=0
    drawsegment(bthreshidx,bthresh,barindex,bthresh)coloured("green")style(dottedline)
    drawpoint(barindex,bthresh,3)coloured("orange")
    elsif close > bthresh then
    awaitingDBC=0
    drawsegment(bthreshidx,bthresh,barindex,bthresh)coloured("green")style(dottedline)
    endif
    endif
    if awaitingDTC and onlysignals=0 then
    barsDTC=barsDTC+1
    if close > Tthresh and barsDTC>x then
    awaitingDTC=0
    drawsegment(Tthreshidx,Tthresh,barindex,Tthresh)coloured("red")style(dottedline)
    drawpoint(barindex,Tthresh,3)coloured("orange")
    elsif close < Tthresh then
    awaitingDTC=0
    drawsegment(Tthreshidx,Tthresh,barindex,Tthresh)coloured("red")style(dottedline)
    endif
    endif
    //----------------------------------------------------------//
    return
    
    #243163 quote
    MaricarmenMaricarmen
    Participant
    Veteran
    Hola: Acabo de verlo y voy a probarlo seguidamente,  estoy seguro que va a ser bueno para todos. Muchísimas gracias, de nuevo.         el foro
Viewing 5 posts - 1 through 5 (of 5 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

Conversión Doble Techo/Suelo


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by MaricarmenMaricarmen
1 year, 7 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 01/12/2025
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...