Elder's Market Thermometer [LazyBear]

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #83818 quote
    bolsatrilera
    Participant
    Master

    Estoy intentando adaptar este código de Lazy Bear, aparecido en la plataforma Tradingview : https://www.tradingview.com/script/HqvTuEMW-Elder-s-Market-Thermometer-LazyBear/

    Tengo hecho este esbozo de código , pero no estoy seguro de que esté correcto 100% , ¿alguién me puede echar una mano?

    REM ELDER´S MARKET THERMOMETER
    // @author LazyBear
    // List of all my indicators:
    // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
    //study("Elder Market Thermometer [LazyBear]", shorttitle="EMT_LB")
    lengthMA=22//input(22, "EMA Length")
    explosiveMktThreshold=3//input(3, title="Explosive Market Threshold")
    idleMarketThreshold=7//input(7, title="Idle Market Threshold")
    
    if emt then
    emt=high<high[1] and low>low[1]
    else
    emt = 0
    endif
    
    if emt then
    emt = (high - high[1]) > (low[1] - low)
    elsif abs(high - high[1]) then
    emt=abs(high - high[1])
    else
    emt= abs(low[1] - low)
    endif
    
    aemt =ExponentialAverage[lengthMA](emt)
    
    if aemt>emt then
    qc=(qc[1])+1
    else
    qc=0
    endif
    
    
    
    if  (emt > aemt) and (emt < aemt*explosiveMktThreshold)then
    r=255
    g=165
    b=0
    else
    r=255
    g=0
    b=0
    endif
    
    if  (emt < aemt) then
    if  qc>idleMarketThreshold then
    r=0
    g=128
    b=0
    else
    r=0
    g=0
    b=255
    endif
    endif
    
    
    return emt coloured(r,g,b)style(histogram)as "Market Thermometer",aemt coloured(255,0,255)as"EMA of Market Thermometer"
    
    #83848 quote
    Nicolas
    Keymaster
    Master

    No creo que sea correcto para la primera parte, no ha traducido correctamente el IFF. Piense en ello como un bloque de condición completo hecho de IF .. THEN .. ELSE

    Debería ser una excelente adición a la biblioteca una vez que haya terminado, hágame saber si necesita más ayuda.

    #83864 quote
    bolsatrilera
    Participant
    Master

    Pués si Nicolas , no doy con ello…

    #84236 quote
    villares
    Participant
    Average
    REM ELDER´S MARKET THERMOMETER
    // @author LazyBear
    // List of all my indicators:
    // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
    //study("Elder Market Thermometer [LazyBear]", shorttitle="EMT_LB")
    lengthMA=22//input(22, "EMA Length")
    explosiveMktThreshold=3//input(3, title="Explosive Market Threshold")
    idleMarketThreshold=7//input(7, title="Idle Market Threshold")
     
    if high<high[1] and low>low[1] then
    emt=0
    elsif (high-high[1])> low[1]-low then
    emt=abs(high-high[1])
    else
    emt = abs(low[1] - low)
    endif
     
    
     
    aemt =ExponentialAverage[lengthMA](emt)
     
    if aemt>emt then
    qc=(qc[1])+1
    else
    qc=0
    endif
     
     
     
    if  (emt > aemt) and (emt < aemt*explosiveMktThreshold)then
    r=255
    g=165
    b=0
    else
    r=255
    g=0
    b=0
    endif
     
    if  (emt < aemt) then
    if  qc>idleMarketThreshold then
    r=0
    g=128
    b=0
    else
    r=0
    g=0
    b=255
    endif
    endif
     
     
    return emt coloured(r,g,b)style(histogram)as "Market Thermometer",aemt coloured(255,0,255)as"EMA of Market Thermometer"

    Hola, un concepto interesante. Creo que el codigo correcto seria este.

    Saludos

    #84259 quote
    bolsatrilera
    Participant
    Master

    Si no es el correcto , se le parece… muchas gracias por traducir la primera parte del código correctamente.siguiendo las líneas de código, he hecho esta pequeña variación para seguir el orden…

    REM ELDER´S MARKET THERMOMETER
    // @author LazyBear
    // List of all my indicators:
    // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
    //study("Elder Market Thermometer [LazyBear]", shorttitle="EMT_LB")
    lengthMA=22//input(22, "EMA Length")
    explosiveMktThreshold=3//input(3, title="Explosive Market Threshold")
    idleMarketThreshold=7//input(7, title="Idle Market Threshold")
    
    if high<high[1] and low>low[1] then
    emt=0
    elsif (high-high[1])> low[1]-low then
    emt=abs(high-high[1])
    else
    emt = abs(low[1] - low)
    endif
    
    
    aemt =ExponentialAverage[lengthMA](emt)
    
    if aemt>emt then
    qc=(qc[1])+1
    else
    qc=0
    endif
    
    if  (emt< aemt) then
    if qc>idleMarketThreshold then
    r=0
    g=128
    b=0
    else
    r=0
    g=0
    b=255
    endif
    elsif  (emt > aemt) and (emt < aemt*explosiveMktThreshold)then
    r=255
    g=165
    b=0
    else
    r=255
    g=0
    b=0
    endif
    
    return emt coloured(r,g,b)style(histogram)as "Market Thermometer",aemt coloured(255,0,255)as"EMA of Market Thermometer"
    
    Nicolas thanked this post
    #84309 quote
    Nicolas
    Keymaster
    Master

    Después de una repetición rápida, creo que esta vez corresponde al código pinescript! Felicidades 🙂
    ¿Por qué no transferirlo a la biblioteca ahora? Te dejo hacerlo;)

    #84325 quote
    bolsatrilera
    Participant
    Master

    Siempre con el permiso de villares, a él lecorresponde la traducción correcta del primer bloque del código.

    #84486 quote
    villares
    Participant
    Average

    Hola, la idea de adaptar este indicador y casi todo el codigo lo has aportado tu, asi que no necesitas mi permiso 🙂

    Saludos cordiales y gracias x tus aportaciones

    Nicolas and bolsatrilera thanked this post
    #84638 quote
    bolsatrilera
    Participant
    Master

    Buenas noches Nicolas. ¿ Podrás subir tú el código de este indicador a la biblioteca?,no sé porque razón no me deja hacerlo

    #84659 quote
    Nicolas
    Keymaster
    Master

    Sí, lo haré con tu propio nombre, lo antes posible. Muchas gracias por esta nueva adición.

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

Elder's Market Thermometer [LazyBear]


ProBuilder: Indicadores y Herramientas

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 10/30/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...