Traducción de indicador "WRBHG" a PRT

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #79776 quote
    Fr7
    Participant
    Master

    Hola, alguien puede traducir el código?

    Lo he sacado de aquí:
    https://www.tradingview.com/script/UIOunhsx-WRBHG/

    Gracias

     

    estudio (“WRBHG”, superposición = verdadero)
    cuerpo = abs (abrir-cerrar)
    wrb = cuerpo> cuerpo [1] y cuerpo> cuerpo [2] y cuerpo> cuerpo [3]? avg (abrir, cerrar): na
    hg = (wrb [1] y (bajo> alto [2] o alto <bajo [2]))? wrb [1]: na
    plot (hg, title = ‘HG’, linewidth = 4, color = black, offset = -1, style = circles)
    plot(wrb, title=’WRB’, linewidth=2, color=aqua, style=circles)

    #79808 quote
    Nicolas
    Keymaster
    Master

    Usted tradujo el código al español, ¿por qué?

    Agregue capturas de pantalla la próxima vez que solicite una traducción de indicador, como ya le pregunté cada vez que realiza una solicitud de traducción de codificación 🙂 Por favor …

    Copie / pegue el código en su idioma original de codificación, no en español. Gracias.

    #79812 quote
    Fr7
    Participant
    Master
    study("WRBHG", overlay=true)
    body = abs(open-close)
    wrb = body>body[1] and body>body[2] and body>body[3] ? avg(open,close) : na
    hg = (wrb[1] and (low>high[2] or high<low[2]))? wrb[1] : na
    plot(hg, title='HG', linewidth=4, color=black, offset=-1, style=circles)
    plot(wrb, title='WRB', linewidth=2, color=aqua, style=circles)

    Disculpe Nicolás,el traductor de google es automático y por eso se traducen los códigos………….

    #79821 quote
    Nicolas
    Keymaster
    Master

    Por favor prueba este código:

    body = abs(open-close)
    if body>body[1] and body>body[2] and body>body[3] then 
    wrb = (open+close)/2
    drawtext("●",barindex,wrb,dialog,bold,20) coloured(100,100,100)
    endif
    if (wrb[1] and (low>high[2] or high<low[2])) then 
    hq = wrb[1] 
    drawtext("●",barindex,hq,dialog,bold,14) coloured(0,255,255)
    endif
    
    return
    #79834 quote
    Fr7
    Participant
    Master

    No funciona bien.Sólo se dibuja el primer círculo.

    No aparece el segundo círculo ,cuando se cumplen las dos condiciones……..

    #79852 quote
    Nicolas
    Keymaster
    Master

    Hay algo mal con la condición booleana y no sé por qué. De todos modos, esta versión es completamente funcional:

    body = abs(open-close)
    if body>body[1] and body>body[2] and body>body[3] then
    wrb = (open+close)/2
    drawtext("●",barindex,wrb,dialog,bold,20) coloured(100,100,100)
    else
    wrb=0
    endif
    if (wrb[1]>0 and (low>high[2] or high<low[2])) then
    hq = wrb[1]
    drawtext("●",barindex[1],hq,dialog,bold,10) coloured(0,255,255)
    endif
    
    return (wrb[1]>0 and (low>high[2] or high<low[2]))
    #79863 quote
    Nicolas
    Keymaster
    Master

    Agregado a nuestra biblioteca de códigos para futura referencia:

    Wide Range Body and Hidden Gap bars (WRBHG)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Traducción de indicador "WRBHG" a PRT


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Fr7 @fr7 Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by Nicolas
7 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 09/04/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...